
obj/user/cat.debug:     file format elf32-i386


Disassembly of section .text:

00800020 <_start>:
// starts us running when we are initially loaded into a new environment.
.text
.globl _start
_start:
	// See if we were started with arguments on the stack
	cmpl $USTACKTOP, %esp
  800020:	81 fc 00 e0 bf ee    	cmp    $0xeebfe000,%esp
	jne args_exist
  800026:	75 04                	jne    80002c <args_exist>

	// If not, push dummy argc/argv arguments.
	// This happens when we are loaded by the kernel,
	// because the kernel does not know about passing arguments.
	pushl $0
  800028:	6a 00                	push   $0x0
	pushl $0
  80002a:	6a 00                	push   $0x0

0080002c <args_exist>:

args_exist:
	call libmain
  80002c:	e8 04 01 00 00       	call   800135 <libmain>
1:	jmp 1b
  800031:	eb fe                	jmp    800031 <args_exist+0x5>

00800033 <cat>:

char buf[8192];

void
cat(int f, char *s)
{
  800033:	f3 0f 1e fb          	endbr32 
  800037:	55                   	push   %ebp
  800038:	89 e5                	mov    %esp,%ebp
  80003a:	56                   	push   %esi
  80003b:	53                   	push   %ebx
  80003c:	8b 75 08             	mov    0x8(%ebp),%esi
	long n;
	int r;

	while ((n = read(f, buf, (long)sizeof(buf))) > 0)
  80003f:	83 ec 04             	sub    $0x4,%esp
  800042:	68 00 20 00 00       	push   $0x2000
  800047:	68 20 40 80 00       	push   $0x804020
  80004c:	56                   	push   %esi
  80004d:	e8 70 11 00 00       	call   8011c2 <read>
  800052:	89 c3                	mov    %eax,%ebx
  800054:	83 c4 10             	add    $0x10,%esp
  800057:	85 c0                	test   %eax,%eax
  800059:	7e 2f                	jle    80008a <cat+0x57>
		if ((r = write(1, buf, n)) != n)
  80005b:	83 ec 04             	sub    $0x4,%esp
  80005e:	53                   	push   %ebx
  80005f:	68 20 40 80 00       	push   $0x804020
  800064:	6a 01                	push   $0x1
  800066:	e8 2d 12 00 00       	call   801298 <write>
  80006b:	83 c4 10             	add    $0x10,%esp
  80006e:	39 c3                	cmp    %eax,%ebx
  800070:	74 cd                	je     80003f <cat+0xc>
			panic("write error copying %s: %e", s, r);
  800072:	83 ec 0c             	sub    $0xc,%esp
  800075:	50                   	push   %eax
  800076:	ff 75 0c             	pushl  0xc(%ebp)
  800079:	68 e0 20 80 00       	push   $0x8020e0
  80007e:	6a 0d                	push   $0xd
  800080:	68 fb 20 80 00       	push   $0x8020fb
  800085:	e8 1d 01 00 00       	call   8001a7 <_panic>
	if (n < 0)
  80008a:	78 07                	js     800093 <cat+0x60>
		panic("error reading %s: %e", s, n);
}
  80008c:	8d 65 f8             	lea    -0x8(%ebp),%esp
  80008f:	5b                   	pop    %ebx
  800090:	5e                   	pop    %esi
  800091:	5d                   	pop    %ebp
  800092:	c3                   	ret    
		panic("error reading %s: %e", s, n);
  800093:	83 ec 0c             	sub    $0xc,%esp
  800096:	50                   	push   %eax
  800097:	ff 75 0c             	pushl  0xc(%ebp)
  80009a:	68 06 21 80 00       	push   $0x802106
  80009f:	6a 0f                	push   $0xf
  8000a1:	68 fb 20 80 00       	push   $0x8020fb
  8000a6:	e8 fc 00 00 00       	call   8001a7 <_panic>

008000ab <umain>:

void
umain(int argc, char **argv)
{
  8000ab:	f3 0f 1e fb          	endbr32 
  8000af:	55                   	push   %ebp
  8000b0:	89 e5                	mov    %esp,%ebp
  8000b2:	57                   	push   %edi
  8000b3:	56                   	push   %esi
  8000b4:	53                   	push   %ebx
  8000b5:	83 ec 0c             	sub    $0xc,%esp
  8000b8:	8b 7d 0c             	mov    0xc(%ebp),%edi
	int f, i;

	binaryname = "cat";
  8000bb:	c7 05 00 30 80 00 1b 	movl   $0x80211b,0x803000
  8000c2:	21 80 00 
	if (argc == 1)
		cat(0, "<stdin>");
	else
		for (i = 1; i < argc; i++) {
  8000c5:	be 01 00 00 00       	mov    $0x1,%esi
	if (argc == 1)
  8000ca:	83 7d 08 01          	cmpl   $0x1,0x8(%ebp)
  8000ce:	75 31                	jne    800101 <umain+0x56>
		cat(0, "<stdin>");
  8000d0:	83 ec 08             	sub    $0x8,%esp
  8000d3:	68 1f 21 80 00       	push   $0x80211f
  8000d8:	6a 00                	push   $0x0
  8000da:	e8 54 ff ff ff       	call   800033 <cat>
  8000df:	83 c4 10             	add    $0x10,%esp
			else {
				cat(f, argv[i]);
				close(f);
			}
		}
}
  8000e2:	8d 65 f4             	lea    -0xc(%ebp),%esp
  8000e5:	5b                   	pop    %ebx
  8000e6:	5e                   	pop    %esi
  8000e7:	5f                   	pop    %edi
  8000e8:	5d                   	pop    %ebp
  8000e9:	c3                   	ret    
				printf("can't open %s: %e\n", argv[i], f);
  8000ea:	83 ec 04             	sub    $0x4,%esp
  8000ed:	50                   	push   %eax
  8000ee:	ff 34 b7             	pushl  (%edi,%esi,4)
  8000f1:	68 27 21 80 00       	push   $0x802127
  8000f6:	e8 13 17 00 00       	call   80180e <printf>
  8000fb:	83 c4 10             	add    $0x10,%esp
		for (i = 1; i < argc; i++) {
  8000fe:	83 c6 01             	add    $0x1,%esi
  800101:	3b 75 08             	cmp    0x8(%ebp),%esi
  800104:	7d dc                	jge    8000e2 <umain+0x37>
			f = open(argv[i], O_RDONLY);
  800106:	83 ec 08             	sub    $0x8,%esp
  800109:	6a 00                	push   $0x0
  80010b:	ff 34 b7             	pushl  (%edi,%esi,4)
  80010e:	e8 44 15 00 00       	call   801657 <open>
  800113:	89 c3                	mov    %eax,%ebx
			if (f < 0)
  800115:	83 c4 10             	add    $0x10,%esp
  800118:	85 c0                	test   %eax,%eax
  80011a:	78 ce                	js     8000ea <umain+0x3f>
				cat(f, argv[i]);
  80011c:	83 ec 08             	sub    $0x8,%esp
  80011f:	ff 34 b7             	pushl  (%edi,%esi,4)
  800122:	50                   	push   %eax
  800123:	e8 0b ff ff ff       	call   800033 <cat>
				close(f);
  800128:	89 1c 24             	mov    %ebx,(%esp)
  80012b:	e8 48 0f 00 00       	call   801078 <close>
  800130:	83 c4 10             	add    $0x10,%esp
  800133:	eb c9                	jmp    8000fe <umain+0x53>

00800135 <libmain>:
const volatile struct Env *thisenv;
const char *binaryname = "<unknown>";

void
libmain(int argc, char **argv)
{
  800135:	f3 0f 1e fb          	endbr32 
  800139:	55                   	push   %ebp
  80013a:	89 e5                	mov    %esp,%ebp
  80013c:	56                   	push   %esi
  80013d:	53                   	push   %ebx
  80013e:	8b 5d 08             	mov    0x8(%ebp),%ebx
  800141:	8b 75 0c             	mov    0xc(%ebp),%esi
	;    //系统调用，我们已经在Exercise 7中实现了
	
	
	
	//屏幕上打印出来了字母，但后续报错了，有意思，让我看看问题出现在哪。
	thisenv=0;
  800144:	c7 05 20 60 80 00 00 	movl   $0x0,0x806020
  80014b:	00 00 00 
	thisenv = &envs[ENVX(sys_getenvid())];      //获取Env结构指针
  80014e:	e8 10 0b 00 00       	call   800c63 <sys_getenvid>
  800153:	25 ff 03 00 00       	and    $0x3ff,%eax
  800158:	6b c0 7c             	imul   $0x7c,%eax,%eax
  80015b:	05 00 00 c0 ee       	add    $0xeec00000,%eax
  800160:	a3 20 60 80 00       	mov    %eax,0x806020

	// save the name of the program so that panic() can use it
	if (argc > 0)
  800165:	85 db                	test   %ebx,%ebx
  800167:	7e 07                	jle    800170 <libmain+0x3b>
		binaryname = argv[0];
  800169:	8b 06                	mov    (%esi),%eax
  80016b:	a3 00 30 80 00       	mov    %eax,0x803000

	// call user main routine
	umain(argc, argv);
  800170:	83 ec 08             	sub    $0x8,%esp
  800173:	56                   	push   %esi
  800174:	53                   	push   %ebx
  800175:	e8 31 ff ff ff       	call   8000ab <umain>

	// exit gracefully
	exit();
  80017a:	e8 0a 00 00 00       	call   800189 <exit>
}
  80017f:	83 c4 10             	add    $0x10,%esp
  800182:	8d 65 f8             	lea    -0x8(%ebp),%esp
  800185:	5b                   	pop    %ebx
  800186:	5e                   	pop    %esi
  800187:	5d                   	pop    %ebp
  800188:	c3                   	ret    

00800189 <exit>:

#include <inc/lib.h>

void
exit(void)
{
  800189:	f3 0f 1e fb          	endbr32 
  80018d:	55                   	push   %ebp
  80018e:	89 e5                	mov    %esp,%ebp
  800190:	83 ec 08             	sub    $0x8,%esp
	close_all();
  800193:	e8 11 0f 00 00       	call   8010a9 <close_all>
	sys_env_destroy(0);
  800198:	83 ec 0c             	sub    $0xc,%esp
  80019b:	6a 00                	push   $0x0
  80019d:	e8 7c 0a 00 00       	call   800c1e <sys_env_destroy>
}
  8001a2:	83 c4 10             	add    $0x10,%esp
  8001a5:	c9                   	leave  
  8001a6:	c3                   	ret    

008001a7 <_panic>:
 * It prints "panic: <message>", then causes a breakpoint exception,
 * which causes JOS to enter the JOS kernel monitor.
 */
void
_panic(const char *file, int line, const char *fmt, ...)
{
  8001a7:	f3 0f 1e fb          	endbr32 
  8001ab:	55                   	push   %ebp
  8001ac:	89 e5                	mov    %esp,%ebp
  8001ae:	56                   	push   %esi
  8001af:	53                   	push   %ebx
	va_list ap;

	va_start(ap, fmt);
  8001b0:	8d 5d 14             	lea    0x14(%ebp),%ebx

	// Print the panic message
	cprintf("[%08x] user panic in %s at %s:%d: ",
  8001b3:	8b 35 00 30 80 00    	mov    0x803000,%esi
  8001b9:	e8 a5 0a 00 00       	call   800c63 <sys_getenvid>
  8001be:	83 ec 0c             	sub    $0xc,%esp
  8001c1:	ff 75 0c             	pushl  0xc(%ebp)
  8001c4:	ff 75 08             	pushl  0x8(%ebp)
  8001c7:	56                   	push   %esi
  8001c8:	50                   	push   %eax
  8001c9:	68 44 21 80 00       	push   $0x802144
  8001ce:	e8 bb 00 00 00       	call   80028e <cprintf>
		sys_getenvid(), binaryname, file, line);
	vcprintf(fmt, ap);
  8001d3:	83 c4 18             	add    $0x18,%esp
  8001d6:	53                   	push   %ebx
  8001d7:	ff 75 10             	pushl  0x10(%ebp)
  8001da:	e8 5a 00 00 00       	call   800239 <vcprintf>
	cprintf("\n");
  8001df:	c7 04 24 63 25 80 00 	movl   $0x802563,(%esp)
  8001e6:	e8 a3 00 00 00       	call   80028e <cprintf>
  8001eb:	83 c4 10             	add    $0x10,%esp

	// Cause a breakpoint exception
	while (1)
		asm volatile("int3");
  8001ee:	cc                   	int3   
  8001ef:	eb fd                	jmp    8001ee <_panic+0x47>

008001f1 <putch>:
};


static void
putch(int ch, struct printbuf *b)
{
  8001f1:	f3 0f 1e fb          	endbr32 
  8001f5:	55                   	push   %ebp
  8001f6:	89 e5                	mov    %esp,%ebp
  8001f8:	53                   	push   %ebx
  8001f9:	83 ec 04             	sub    $0x4,%esp
  8001fc:	8b 5d 0c             	mov    0xc(%ebp),%ebx
	b->buf[b->idx++] = ch;
  8001ff:	8b 13                	mov    (%ebx),%edx
  800201:	8d 42 01             	lea    0x1(%edx),%eax
  800204:	89 03                	mov    %eax,(%ebx)
  800206:	8b 4d 08             	mov    0x8(%ebp),%ecx
  800209:	88 4c 13 08          	mov    %cl,0x8(%ebx,%edx,1)
	if (b->idx == 256-1) {
  80020d:	3d ff 00 00 00       	cmp    $0xff,%eax
  800212:	74 09                	je     80021d <putch+0x2c>
		sys_cputs(b->buf, b->idx);
		b->idx = 0;
	}
	b->cnt++;
  800214:	83 43 04 01          	addl   $0x1,0x4(%ebx)
}
  800218:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  80021b:	c9                   	leave  
  80021c:	c3                   	ret    
		sys_cputs(b->buf, b->idx);
  80021d:	83 ec 08             	sub    $0x8,%esp
  800220:	68 ff 00 00 00       	push   $0xff
  800225:	8d 43 08             	lea    0x8(%ebx),%eax
  800228:	50                   	push   %eax
  800229:	e8 ab 09 00 00       	call   800bd9 <sys_cputs>
		b->idx = 0;
  80022e:	c7 03 00 00 00 00    	movl   $0x0,(%ebx)
  800234:	83 c4 10             	add    $0x10,%esp
  800237:	eb db                	jmp    800214 <putch+0x23>

00800239 <vcprintf>:

int
vcprintf(const char *fmt, va_list ap)
{
  800239:	f3 0f 1e fb          	endbr32 
  80023d:	55                   	push   %ebp
  80023e:	89 e5                	mov    %esp,%ebp
  800240:	81 ec 18 01 00 00    	sub    $0x118,%esp
	struct printbuf b;

	b.idx = 0;
  800246:	c7 85 f0 fe ff ff 00 	movl   $0x0,-0x110(%ebp)
  80024d:	00 00 00 
	b.cnt = 0;
  800250:	c7 85 f4 fe ff ff 00 	movl   $0x0,-0x10c(%ebp)
  800257:	00 00 00 
	vprintfmt((void*)putch, &b, fmt, ap);
  80025a:	ff 75 0c             	pushl  0xc(%ebp)
  80025d:	ff 75 08             	pushl  0x8(%ebp)
  800260:	8d 85 f0 fe ff ff    	lea    -0x110(%ebp),%eax
  800266:	50                   	push   %eax
  800267:	68 f1 01 80 00       	push   $0x8001f1
  80026c:	e8 20 01 00 00       	call   800391 <vprintfmt>
	sys_cputs(b.buf, b.idx);
  800271:	83 c4 08             	add    $0x8,%esp
  800274:	ff b5 f0 fe ff ff    	pushl  -0x110(%ebp)
  80027a:	8d 85 f8 fe ff ff    	lea    -0x108(%ebp),%eax
  800280:	50                   	push   %eax
  800281:	e8 53 09 00 00       	call   800bd9 <sys_cputs>

	return b.cnt;
}
  800286:	8b 85 f4 fe ff ff    	mov    -0x10c(%ebp),%eax
  80028c:	c9                   	leave  
  80028d:	c3                   	ret    

0080028e <cprintf>:

int
cprintf(const char *fmt, ...)
{
  80028e:	f3 0f 1e fb          	endbr32 
  800292:	55                   	push   %ebp
  800293:	89 e5                	mov    %esp,%ebp
  800295:	83 ec 10             	sub    $0x10,%esp
	va_list ap;
	int cnt;

	va_start(ap, fmt);
  800298:	8d 45 0c             	lea    0xc(%ebp),%eax
	cnt = vcprintf(fmt, ap);
  80029b:	50                   	push   %eax
  80029c:	ff 75 08             	pushl  0x8(%ebp)
  80029f:	e8 95 ff ff ff       	call   800239 <vcprintf>
	va_end(ap);

	return cnt;
}
  8002a4:	c9                   	leave  
  8002a5:	c3                   	ret    

008002a6 <printnum>:
 * using specified putch function and associated pointer putdat.
 */
static void
printnum(void (*putch)(int, void*), void *putdat,
	 unsigned long long num, unsigned base, int width, int padc)
{
  8002a6:	55                   	push   %ebp
  8002a7:	89 e5                	mov    %esp,%ebp
  8002a9:	57                   	push   %edi
  8002aa:	56                   	push   %esi
  8002ab:	53                   	push   %ebx
  8002ac:	83 ec 1c             	sub    $0x1c,%esp
  8002af:	89 c7                	mov    %eax,%edi
  8002b1:	89 d6                	mov    %edx,%esi
  8002b3:	8b 45 08             	mov    0x8(%ebp),%eax
  8002b6:	8b 55 0c             	mov    0xc(%ebp),%edx
  8002b9:	89 d1                	mov    %edx,%ecx
  8002bb:	89 c2                	mov    %eax,%edx
  8002bd:	89 45 d8             	mov    %eax,-0x28(%ebp)
  8002c0:	89 4d dc             	mov    %ecx,-0x24(%ebp)
  8002c3:	8b 45 10             	mov    0x10(%ebp),%eax
  8002c6:	8b 5d 14             	mov    0x14(%ebp),%ebx
	// first recursively print all preceding (more significant) digits
	if (num >= base) {
  8002c9:	89 45 e0             	mov    %eax,-0x20(%ebp)
  8002cc:	c7 45 e4 00 00 00 00 	movl   $0x0,-0x1c(%ebp)
  8002d3:	39 c2                	cmp    %eax,%edx
  8002d5:	1b 4d e4             	sbb    -0x1c(%ebp),%ecx
  8002d8:	72 3e                	jb     800318 <printnum+0x72>
		printnum(putch, putdat, num / base, base, width - 1, padc);
  8002da:	83 ec 0c             	sub    $0xc,%esp
  8002dd:	ff 75 18             	pushl  0x18(%ebp)
  8002e0:	83 eb 01             	sub    $0x1,%ebx
  8002e3:	53                   	push   %ebx
  8002e4:	50                   	push   %eax
  8002e5:	83 ec 08             	sub    $0x8,%esp
  8002e8:	ff 75 e4             	pushl  -0x1c(%ebp)
  8002eb:	ff 75 e0             	pushl  -0x20(%ebp)
  8002ee:	ff 75 dc             	pushl  -0x24(%ebp)
  8002f1:	ff 75 d8             	pushl  -0x28(%ebp)
  8002f4:	e8 87 1b 00 00       	call   801e80 <__udivdi3>
  8002f9:	83 c4 18             	add    $0x18,%esp
  8002fc:	52                   	push   %edx
  8002fd:	50                   	push   %eax
  8002fe:	89 f2                	mov    %esi,%edx
  800300:	89 f8                	mov    %edi,%eax
  800302:	e8 9f ff ff ff       	call   8002a6 <printnum>
  800307:	83 c4 20             	add    $0x20,%esp
  80030a:	eb 13                	jmp    80031f <printnum+0x79>
	} else {
		// print any needed pad characters before first digit
		while (--width > 0)
			putch(padc, putdat);
  80030c:	83 ec 08             	sub    $0x8,%esp
  80030f:	56                   	push   %esi
  800310:	ff 75 18             	pushl  0x18(%ebp)
  800313:	ff d7                	call   *%edi
  800315:	83 c4 10             	add    $0x10,%esp
		while (--width > 0)
  800318:	83 eb 01             	sub    $0x1,%ebx
  80031b:	85 db                	test   %ebx,%ebx
  80031d:	7f ed                	jg     80030c <printnum+0x66>
	}

	// then print this (the least significant) digit
	putch("0123456789abcdef"[num % base], putdat);
  80031f:	83 ec 08             	sub    $0x8,%esp
  800322:	56                   	push   %esi
  800323:	83 ec 04             	sub    $0x4,%esp
  800326:	ff 75 e4             	pushl  -0x1c(%ebp)
  800329:	ff 75 e0             	pushl  -0x20(%ebp)
  80032c:	ff 75 dc             	pushl  -0x24(%ebp)
  80032f:	ff 75 d8             	pushl  -0x28(%ebp)
  800332:	e8 59 1c 00 00       	call   801f90 <__umoddi3>
  800337:	83 c4 14             	add    $0x14,%esp
  80033a:	0f be 80 67 21 80 00 	movsbl 0x802167(%eax),%eax
  800341:	50                   	push   %eax
  800342:	ff d7                	call   *%edi
}
  800344:	83 c4 10             	add    $0x10,%esp
  800347:	8d 65 f4             	lea    -0xc(%ebp),%esp
  80034a:	5b                   	pop    %ebx
  80034b:	5e                   	pop    %esi
  80034c:	5f                   	pop    %edi
  80034d:	5d                   	pop    %ebp
  80034e:	c3                   	ret    

0080034f <sprintputch>:
	int cnt;
};

static void
sprintputch(int ch, struct sprintbuf *b)
{
  80034f:	f3 0f 1e fb          	endbr32 
  800353:	55                   	push   %ebp
  800354:	89 e5                	mov    %esp,%ebp
  800356:	8b 45 0c             	mov    0xc(%ebp),%eax
	b->cnt++;
  800359:	83 40 08 01          	addl   $0x1,0x8(%eax)
	if (b->buf < b->ebuf)
  80035d:	8b 10                	mov    (%eax),%edx
  80035f:	3b 50 04             	cmp    0x4(%eax),%edx
  800362:	73 0a                	jae    80036e <sprintputch+0x1f>
		*b->buf++ = ch;
  800364:	8d 4a 01             	lea    0x1(%edx),%ecx
  800367:	89 08                	mov    %ecx,(%eax)
  800369:	8b 45 08             	mov    0x8(%ebp),%eax
  80036c:	88 02                	mov    %al,(%edx)
}
  80036e:	5d                   	pop    %ebp
  80036f:	c3                   	ret    

00800370 <printfmt>:
{
  800370:	f3 0f 1e fb          	endbr32 
  800374:	55                   	push   %ebp
  800375:	89 e5                	mov    %esp,%ebp
  800377:	83 ec 08             	sub    $0x8,%esp
	va_start(ap, fmt);
  80037a:	8d 45 14             	lea    0x14(%ebp),%eax
	vprintfmt(putch, putdat, fmt, ap);
  80037d:	50                   	push   %eax
  80037e:	ff 75 10             	pushl  0x10(%ebp)
  800381:	ff 75 0c             	pushl  0xc(%ebp)
  800384:	ff 75 08             	pushl  0x8(%ebp)
  800387:	e8 05 00 00 00       	call   800391 <vprintfmt>
}
  80038c:	83 c4 10             	add    $0x10,%esp
  80038f:	c9                   	leave  
  800390:	c3                   	ret    

00800391 <vprintfmt>:
{
  800391:	f3 0f 1e fb          	endbr32 
  800395:	55                   	push   %ebp
  800396:	89 e5                	mov    %esp,%ebp
  800398:	57                   	push   %edi
  800399:	56                   	push   %esi
  80039a:	53                   	push   %ebx
  80039b:	83 ec 3c             	sub    $0x3c,%esp
  80039e:	8b 75 08             	mov    0x8(%ebp),%esi
  8003a1:	8b 5d 0c             	mov    0xc(%ebp),%ebx
  8003a4:	8b 7d 10             	mov    0x10(%ebp),%edi
  8003a7:	e9 5d 03 00 00       	jmp    800709 <vprintfmt+0x378>
		padc = ' ';
  8003ac:	c6 45 d3 20          	movb   $0x20,-0x2d(%ebp)
		altflag = 0;
  8003b0:	c7 45 e0 00 00 00 00 	movl   $0x0,-0x20(%ebp)
		precision = -1;
  8003b7:	c7 45 d8 ff ff ff ff 	movl   $0xffffffff,-0x28(%ebp)
		width = -1;
  8003be:	c7 45 d4 ff ff ff ff 	movl   $0xffffffff,-0x2c(%ebp)
		lflag = 0;
  8003c5:	b9 00 00 00 00       	mov    $0x0,%ecx
		switch (ch = *(unsigned char *) fmt++) {
  8003ca:	8d 47 01             	lea    0x1(%edi),%eax
  8003cd:	89 45 e4             	mov    %eax,-0x1c(%ebp)
  8003d0:	0f b6 17             	movzbl (%edi),%edx
  8003d3:	8d 42 dd             	lea    -0x23(%edx),%eax
  8003d6:	3c 55                	cmp    $0x55,%al
  8003d8:	0f 87 ae 03 00 00    	ja     80078c <vprintfmt+0x3fb>
  8003de:	0f b6 c0             	movzbl %al,%eax
  8003e1:	3e ff 24 85 a0 22 80 	notrack jmp *0x8022a0(,%eax,4)
  8003e8:	00 
  8003e9:	8b 7d e4             	mov    -0x1c(%ebp),%edi
			padc = '-';
  8003ec:	c6 45 d3 2d          	movb   $0x2d,-0x2d(%ebp)
  8003f0:	eb d8                	jmp    8003ca <vprintfmt+0x39>
		switch (ch = *(unsigned char *) fmt++) {
  8003f2:	8b 7d e4             	mov    -0x1c(%ebp),%edi
  8003f5:	c6 45 d3 30          	movb   $0x30,-0x2d(%ebp)
  8003f9:	eb cf                	jmp    8003ca <vprintfmt+0x39>
  8003fb:	0f b6 d2             	movzbl %dl,%edx
  8003fe:	8b 7d e4             	mov    -0x1c(%ebp),%edi
			for (precision = 0; ; ++fmt) {
  800401:	b8 00 00 00 00       	mov    $0x0,%eax
  800406:	89 4d e4             	mov    %ecx,-0x1c(%ebp)
				precision = precision * 10 + ch - '0';
  800409:	8d 04 80             	lea    (%eax,%eax,4),%eax
  80040c:	8d 44 42 d0          	lea    -0x30(%edx,%eax,2),%eax
				ch = *fmt;
  800410:	0f be 17             	movsbl (%edi),%edx
				if (ch < '0' || ch > '9')
  800413:	8d 4a d0             	lea    -0x30(%edx),%ecx
  800416:	83 f9 09             	cmp    $0x9,%ecx
  800419:	77 55                	ja     800470 <vprintfmt+0xdf>
			for (precision = 0; ; ++fmt) {
  80041b:	83 c7 01             	add    $0x1,%edi
				precision = precision * 10 + ch - '0';
  80041e:	eb e9                	jmp    800409 <vprintfmt+0x78>
			precision = va_arg(ap, int);
  800420:	8b 45 14             	mov    0x14(%ebp),%eax
  800423:	8b 00                	mov    (%eax),%eax
  800425:	89 45 d8             	mov    %eax,-0x28(%ebp)
  800428:	8b 45 14             	mov    0x14(%ebp),%eax
  80042b:	8d 40 04             	lea    0x4(%eax),%eax
  80042e:	89 45 14             	mov    %eax,0x14(%ebp)
		switch (ch = *(unsigned char *) fmt++) {
  800431:	8b 7d e4             	mov    -0x1c(%ebp),%edi
			if (width < 0)
  800434:	83 7d d4 00          	cmpl   $0x0,-0x2c(%ebp)
  800438:	79 90                	jns    8003ca <vprintfmt+0x39>
				width = precision, precision = -1;
  80043a:	8b 45 d8             	mov    -0x28(%ebp),%eax
  80043d:	89 45 d4             	mov    %eax,-0x2c(%ebp)
  800440:	c7 45 d8 ff ff ff ff 	movl   $0xffffffff,-0x28(%ebp)
  800447:	eb 81                	jmp    8003ca <vprintfmt+0x39>
  800449:	8b 45 d4             	mov    -0x2c(%ebp),%eax
  80044c:	85 c0                	test   %eax,%eax
  80044e:	ba 00 00 00 00       	mov    $0x0,%edx
  800453:	0f 49 d0             	cmovns %eax,%edx
  800456:	89 55 d4             	mov    %edx,-0x2c(%ebp)
		switch (ch = *(unsigned char *) fmt++) {
  800459:	8b 7d e4             	mov    -0x1c(%ebp),%edi
			goto reswitch;
  80045c:	e9 69 ff ff ff       	jmp    8003ca <vprintfmt+0x39>
		switch (ch = *(unsigned char *) fmt++) {
  800461:	8b 7d e4             	mov    -0x1c(%ebp),%edi
			altflag = 1;
  800464:	c7 45 e0 01 00 00 00 	movl   $0x1,-0x20(%ebp)
			goto reswitch;
  80046b:	e9 5a ff ff ff       	jmp    8003ca <vprintfmt+0x39>
  800470:	8b 4d e4             	mov    -0x1c(%ebp),%ecx
  800473:	89 45 d8             	mov    %eax,-0x28(%ebp)
  800476:	eb bc                	jmp    800434 <vprintfmt+0xa3>
			lflag++;
  800478:	83 c1 01             	add    $0x1,%ecx
		switch (ch = *(unsigned char *) fmt++) {
  80047b:	8b 7d e4             	mov    -0x1c(%ebp),%edi
			goto reswitch;
  80047e:	e9 47 ff ff ff       	jmp    8003ca <vprintfmt+0x39>
			putch(va_arg(ap, int), putdat);
  800483:	8b 45 14             	mov    0x14(%ebp),%eax
  800486:	8d 78 04             	lea    0x4(%eax),%edi
  800489:	83 ec 08             	sub    $0x8,%esp
  80048c:	53                   	push   %ebx
  80048d:	ff 30                	pushl  (%eax)
  80048f:	ff d6                	call   *%esi
			break;
  800491:	83 c4 10             	add    $0x10,%esp
			putch(va_arg(ap, int), putdat);
  800494:	89 7d 14             	mov    %edi,0x14(%ebp)
			break;
  800497:	e9 6a 02 00 00       	jmp    800706 <vprintfmt+0x375>
			err = va_arg(ap, int);
  80049c:	8b 45 14             	mov    0x14(%ebp),%eax
  80049f:	8d 78 04             	lea    0x4(%eax),%edi
  8004a2:	8b 00                	mov    (%eax),%eax
  8004a4:	99                   	cltd   
  8004a5:	31 d0                	xor    %edx,%eax
  8004a7:	29 d0                	sub    %edx,%eax
			if (err >= MAXERROR || (p = error_string[err]) == NULL)
  8004a9:	83 f8 0f             	cmp    $0xf,%eax
  8004ac:	7f 23                	jg     8004d1 <vprintfmt+0x140>
  8004ae:	8b 14 85 00 24 80 00 	mov    0x802400(,%eax,4),%edx
  8004b5:	85 d2                	test   %edx,%edx
  8004b7:	74 18                	je     8004d1 <vprintfmt+0x140>
				printfmt(putch, putdat, "%s", p);
  8004b9:	52                   	push   %edx
  8004ba:	68 31 25 80 00       	push   $0x802531
  8004bf:	53                   	push   %ebx
  8004c0:	56                   	push   %esi
  8004c1:	e8 aa fe ff ff       	call   800370 <printfmt>
  8004c6:	83 c4 10             	add    $0x10,%esp
			err = va_arg(ap, int);
  8004c9:	89 7d 14             	mov    %edi,0x14(%ebp)
  8004cc:	e9 35 02 00 00       	jmp    800706 <vprintfmt+0x375>
				printfmt(putch, putdat, "error %d", err);
  8004d1:	50                   	push   %eax
  8004d2:	68 7f 21 80 00       	push   $0x80217f
  8004d7:	53                   	push   %ebx
  8004d8:	56                   	push   %esi
  8004d9:	e8 92 fe ff ff       	call   800370 <printfmt>
  8004de:	83 c4 10             	add    $0x10,%esp
			err = va_arg(ap, int);
  8004e1:	89 7d 14             	mov    %edi,0x14(%ebp)
				printfmt(putch, putdat, "error %d", err);
  8004e4:	e9 1d 02 00 00       	jmp    800706 <vprintfmt+0x375>
			if ((p = va_arg(ap, char *)) == NULL)
  8004e9:	8b 45 14             	mov    0x14(%ebp),%eax
  8004ec:	83 c0 04             	add    $0x4,%eax
  8004ef:	89 45 c8             	mov    %eax,-0x38(%ebp)
  8004f2:	8b 45 14             	mov    0x14(%ebp),%eax
  8004f5:	8b 10                	mov    (%eax),%edx
				p = "(null)";
  8004f7:	85 d2                	test   %edx,%edx
  8004f9:	b8 78 21 80 00       	mov    $0x802178,%eax
  8004fe:	0f 45 c2             	cmovne %edx,%eax
  800501:	89 45 cc             	mov    %eax,-0x34(%ebp)
			if (width > 0 && padc != '-')
  800504:	83 7d d4 00          	cmpl   $0x0,-0x2c(%ebp)
  800508:	7e 06                	jle    800510 <vprintfmt+0x17f>
  80050a:	80 7d d3 2d          	cmpb   $0x2d,-0x2d(%ebp)
  80050e:	75 0d                	jne    80051d <vprintfmt+0x18c>
				for (width -= strnlen(p, precision); width > 0; width--)
  800510:	8b 45 cc             	mov    -0x34(%ebp),%eax
  800513:	89 c7                	mov    %eax,%edi
  800515:	03 45 d4             	add    -0x2c(%ebp),%eax
  800518:	89 45 d4             	mov    %eax,-0x2c(%ebp)
  80051b:	eb 55                	jmp    800572 <vprintfmt+0x1e1>
  80051d:	83 ec 08             	sub    $0x8,%esp
  800520:	ff 75 d8             	pushl  -0x28(%ebp)
  800523:	ff 75 cc             	pushl  -0x34(%ebp)
  800526:	e8 15 03 00 00       	call   800840 <strnlen>
  80052b:	8b 55 d4             	mov    -0x2c(%ebp),%edx
  80052e:	29 c2                	sub    %eax,%edx
  800530:	89 55 c4             	mov    %edx,-0x3c(%ebp)
  800533:	83 c4 10             	add    $0x10,%esp
  800536:	89 d7                	mov    %edx,%edi
					putch(padc, putdat);
  800538:	0f be 45 d3          	movsbl -0x2d(%ebp),%eax
  80053c:	89 45 d4             	mov    %eax,-0x2c(%ebp)
				for (width -= strnlen(p, precision); width > 0; width--)
  80053f:	85 ff                	test   %edi,%edi
  800541:	7e 11                	jle    800554 <vprintfmt+0x1c3>
					putch(padc, putdat);
  800543:	83 ec 08             	sub    $0x8,%esp
  800546:	53                   	push   %ebx
  800547:	ff 75 d4             	pushl  -0x2c(%ebp)
  80054a:	ff d6                	call   *%esi
				for (width -= strnlen(p, precision); width > 0; width--)
  80054c:	83 ef 01             	sub    $0x1,%edi
  80054f:	83 c4 10             	add    $0x10,%esp
  800552:	eb eb                	jmp    80053f <vprintfmt+0x1ae>
  800554:	8b 55 c4             	mov    -0x3c(%ebp),%edx
  800557:	85 d2                	test   %edx,%edx
  800559:	b8 00 00 00 00       	mov    $0x0,%eax
  80055e:	0f 49 c2             	cmovns %edx,%eax
  800561:	29 c2                	sub    %eax,%edx
  800563:	89 55 d4             	mov    %edx,-0x2c(%ebp)
  800566:	eb a8                	jmp    800510 <vprintfmt+0x17f>
					putch(ch, putdat);
  800568:	83 ec 08             	sub    $0x8,%esp
  80056b:	53                   	push   %ebx
  80056c:	52                   	push   %edx
  80056d:	ff d6                	call   *%esi
  80056f:	83 c4 10             	add    $0x10,%esp
  800572:	8b 4d d4             	mov    -0x2c(%ebp),%ecx
  800575:	29 f9                	sub    %edi,%ecx
			for (; (ch = *p++) != '\0' && (precision < 0 || --precision >= 0); width--)
  800577:	83 c7 01             	add    $0x1,%edi
  80057a:	0f b6 47 ff          	movzbl -0x1(%edi),%eax
  80057e:	0f be d0             	movsbl %al,%edx
  800581:	85 d2                	test   %edx,%edx
  800583:	74 4b                	je     8005d0 <vprintfmt+0x23f>
  800585:	83 7d d8 00          	cmpl   $0x0,-0x28(%ebp)
  800589:	78 06                	js     800591 <vprintfmt+0x200>
  80058b:	83 6d d8 01          	subl   $0x1,-0x28(%ebp)
  80058f:	78 1e                	js     8005af <vprintfmt+0x21e>
				if (altflag && (ch < ' ' || ch > '~'))
  800591:	83 7d e0 00          	cmpl   $0x0,-0x20(%ebp)
  800595:	74 d1                	je     800568 <vprintfmt+0x1d7>
  800597:	0f be c0             	movsbl %al,%eax
  80059a:	83 e8 20             	sub    $0x20,%eax
  80059d:	83 f8 5e             	cmp    $0x5e,%eax
  8005a0:	76 c6                	jbe    800568 <vprintfmt+0x1d7>
					putch('?', putdat);
  8005a2:	83 ec 08             	sub    $0x8,%esp
  8005a5:	53                   	push   %ebx
  8005a6:	6a 3f                	push   $0x3f
  8005a8:	ff d6                	call   *%esi
  8005aa:	83 c4 10             	add    $0x10,%esp
  8005ad:	eb c3                	jmp    800572 <vprintfmt+0x1e1>
  8005af:	89 cf                	mov    %ecx,%edi
  8005b1:	eb 0e                	jmp    8005c1 <vprintfmt+0x230>
				putch(' ', putdat);
  8005b3:	83 ec 08             	sub    $0x8,%esp
  8005b6:	53                   	push   %ebx
  8005b7:	6a 20                	push   $0x20
  8005b9:	ff d6                	call   *%esi
			for (; width > 0; width--)
  8005bb:	83 ef 01             	sub    $0x1,%edi
  8005be:	83 c4 10             	add    $0x10,%esp
  8005c1:	85 ff                	test   %edi,%edi
  8005c3:	7f ee                	jg     8005b3 <vprintfmt+0x222>
			if ((p = va_arg(ap, char *)) == NULL)
  8005c5:	8b 45 c8             	mov    -0x38(%ebp),%eax
  8005c8:	89 45 14             	mov    %eax,0x14(%ebp)
  8005cb:	e9 36 01 00 00       	jmp    800706 <vprintfmt+0x375>
  8005d0:	89 cf                	mov    %ecx,%edi
  8005d2:	eb ed                	jmp    8005c1 <vprintfmt+0x230>
	if (lflag >= 2)
  8005d4:	83 f9 01             	cmp    $0x1,%ecx
  8005d7:	7f 1f                	jg     8005f8 <vprintfmt+0x267>
	else if (lflag)
  8005d9:	85 c9                	test   %ecx,%ecx
  8005db:	74 67                	je     800644 <vprintfmt+0x2b3>
		return va_arg(*ap, long);
  8005dd:	8b 45 14             	mov    0x14(%ebp),%eax
  8005e0:	8b 00                	mov    (%eax),%eax
  8005e2:	89 45 d8             	mov    %eax,-0x28(%ebp)
  8005e5:	89 c1                	mov    %eax,%ecx
  8005e7:	c1 f9 1f             	sar    $0x1f,%ecx
  8005ea:	89 4d dc             	mov    %ecx,-0x24(%ebp)
  8005ed:	8b 45 14             	mov    0x14(%ebp),%eax
  8005f0:	8d 40 04             	lea    0x4(%eax),%eax
  8005f3:	89 45 14             	mov    %eax,0x14(%ebp)
  8005f6:	eb 17                	jmp    80060f <vprintfmt+0x27e>
		return va_arg(*ap, long long);
  8005f8:	8b 45 14             	mov    0x14(%ebp),%eax
  8005fb:	8b 50 04             	mov    0x4(%eax),%edx
  8005fe:	8b 00                	mov    (%eax),%eax
  800600:	89 45 d8             	mov    %eax,-0x28(%ebp)
  800603:	89 55 dc             	mov    %edx,-0x24(%ebp)
  800606:	8b 45 14             	mov    0x14(%ebp),%eax
  800609:	8d 40 08             	lea    0x8(%eax),%eax
  80060c:	89 45 14             	mov    %eax,0x14(%ebp)
			if ((long long) num < 0) {
  80060f:	8b 55 d8             	mov    -0x28(%ebp),%edx
  800612:	8b 4d dc             	mov    -0x24(%ebp),%ecx
			base = 10;
  800615:	b8 0a 00 00 00       	mov    $0xa,%eax
			if ((long long) num < 0) {
  80061a:	85 c9                	test   %ecx,%ecx
  80061c:	0f 89 ca 00 00 00    	jns    8006ec <vprintfmt+0x35b>
				putch('-', putdat);
  800622:	83 ec 08             	sub    $0x8,%esp
  800625:	53                   	push   %ebx
  800626:	6a 2d                	push   $0x2d
  800628:	ff d6                	call   *%esi
				num = -(long long) num;
  80062a:	8b 55 d8             	mov    -0x28(%ebp),%edx
  80062d:	8b 4d dc             	mov    -0x24(%ebp),%ecx
  800630:	f7 da                	neg    %edx
  800632:	83 d1 00             	adc    $0x0,%ecx
  800635:	f7 d9                	neg    %ecx
  800637:	83 c4 10             	add    $0x10,%esp
			base = 10;
  80063a:	b8 0a 00 00 00       	mov    $0xa,%eax
  80063f:	e9 a8 00 00 00       	jmp    8006ec <vprintfmt+0x35b>
		return va_arg(*ap, int);
  800644:	8b 45 14             	mov    0x14(%ebp),%eax
  800647:	8b 00                	mov    (%eax),%eax
  800649:	89 45 d8             	mov    %eax,-0x28(%ebp)
  80064c:	99                   	cltd   
  80064d:	89 55 dc             	mov    %edx,-0x24(%ebp)
  800650:	8b 45 14             	mov    0x14(%ebp),%eax
  800653:	8d 40 04             	lea    0x4(%eax),%eax
  800656:	89 45 14             	mov    %eax,0x14(%ebp)
  800659:	eb b4                	jmp    80060f <vprintfmt+0x27e>
	if (lflag >= 2)
  80065b:	83 f9 01             	cmp    $0x1,%ecx
  80065e:	7f 1b                	jg     80067b <vprintfmt+0x2ea>
	else if (lflag)
  800660:	85 c9                	test   %ecx,%ecx
  800662:	74 2c                	je     800690 <vprintfmt+0x2ff>
		return va_arg(*ap, unsigned long);
  800664:	8b 45 14             	mov    0x14(%ebp),%eax
  800667:	8b 10                	mov    (%eax),%edx
  800669:	b9 00 00 00 00       	mov    $0x0,%ecx
  80066e:	8d 40 04             	lea    0x4(%eax),%eax
  800671:	89 45 14             	mov    %eax,0x14(%ebp)
			base = 10;
  800674:	b8 0a 00 00 00       	mov    $0xa,%eax
		return va_arg(*ap, unsigned long);
  800679:	eb 71                	jmp    8006ec <vprintfmt+0x35b>
		return va_arg(*ap, unsigned long long);
  80067b:	8b 45 14             	mov    0x14(%ebp),%eax
  80067e:	8b 10                	mov    (%eax),%edx
  800680:	8b 48 04             	mov    0x4(%eax),%ecx
  800683:	8d 40 08             	lea    0x8(%eax),%eax
  800686:	89 45 14             	mov    %eax,0x14(%ebp)
			base = 10;
  800689:	b8 0a 00 00 00       	mov    $0xa,%eax
		return va_arg(*ap, unsigned long long);
  80068e:	eb 5c                	jmp    8006ec <vprintfmt+0x35b>
		return va_arg(*ap, unsigned int);
  800690:	8b 45 14             	mov    0x14(%ebp),%eax
  800693:	8b 10                	mov    (%eax),%edx
  800695:	b9 00 00 00 00       	mov    $0x0,%ecx
  80069a:	8d 40 04             	lea    0x4(%eax),%eax
  80069d:	89 45 14             	mov    %eax,0x14(%ebp)
			base = 10;
  8006a0:	b8 0a 00 00 00       	mov    $0xa,%eax
		return va_arg(*ap, unsigned int);
  8006a5:	eb 45                	jmp    8006ec <vprintfmt+0x35b>
			putch('X', putdat);
  8006a7:	83 ec 08             	sub    $0x8,%esp
  8006aa:	53                   	push   %ebx
  8006ab:	6a 58                	push   $0x58
  8006ad:	ff d6                	call   *%esi
			putch('X', putdat);
  8006af:	83 c4 08             	add    $0x8,%esp
  8006b2:	53                   	push   %ebx
  8006b3:	6a 58                	push   $0x58
  8006b5:	ff d6                	call   *%esi
			putch('X', putdat);
  8006b7:	83 c4 08             	add    $0x8,%esp
  8006ba:	53                   	push   %ebx
  8006bb:	6a 58                	push   $0x58
  8006bd:	ff d6                	call   *%esi
			break;
  8006bf:	83 c4 10             	add    $0x10,%esp
  8006c2:	eb 42                	jmp    800706 <vprintfmt+0x375>
			putch('0', putdat);
  8006c4:	83 ec 08             	sub    $0x8,%esp
  8006c7:	53                   	push   %ebx
  8006c8:	6a 30                	push   $0x30
  8006ca:	ff d6                	call   *%esi
			putch('x', putdat);
  8006cc:	83 c4 08             	add    $0x8,%esp
  8006cf:	53                   	push   %ebx
  8006d0:	6a 78                	push   $0x78
  8006d2:	ff d6                	call   *%esi
			num = (unsigned long long)
  8006d4:	8b 45 14             	mov    0x14(%ebp),%eax
  8006d7:	8b 10                	mov    (%eax),%edx
  8006d9:	b9 00 00 00 00       	mov    $0x0,%ecx
			goto number;
  8006de:	83 c4 10             	add    $0x10,%esp
				(uintptr_t) va_arg(ap, void *);
  8006e1:	8d 40 04             	lea    0x4(%eax),%eax
  8006e4:	89 45 14             	mov    %eax,0x14(%ebp)
			base = 16;
  8006e7:	b8 10 00 00 00       	mov    $0x10,%eax
			printnum(putch, putdat, num, base, width, padc);
  8006ec:	83 ec 0c             	sub    $0xc,%esp
  8006ef:	0f be 7d d3          	movsbl -0x2d(%ebp),%edi
  8006f3:	57                   	push   %edi
  8006f4:	ff 75 d4             	pushl  -0x2c(%ebp)
  8006f7:	50                   	push   %eax
  8006f8:	51                   	push   %ecx
  8006f9:	52                   	push   %edx
  8006fa:	89 da                	mov    %ebx,%edx
  8006fc:	89 f0                	mov    %esi,%eax
  8006fe:	e8 a3 fb ff ff       	call   8002a6 <printnum>
			break;
  800703:	83 c4 20             	add    $0x20,%esp
			if ((p = va_arg(ap, char *)) == NULL)
  800706:	8b 7d e4             	mov    -0x1c(%ebp),%edi
		while ((ch = *(unsigned char *) fmt++) != '%') {
  800709:	83 c7 01             	add    $0x1,%edi
  80070c:	0f b6 47 ff          	movzbl -0x1(%edi),%eax
  800710:	83 f8 25             	cmp    $0x25,%eax
  800713:	0f 84 93 fc ff ff    	je     8003ac <vprintfmt+0x1b>
			if (ch == '\0')
  800719:	85 c0                	test   %eax,%eax
  80071b:	0f 84 8b 00 00 00    	je     8007ac <vprintfmt+0x41b>
			putch(ch, putdat);
  800721:	83 ec 08             	sub    $0x8,%esp
  800724:	53                   	push   %ebx
  800725:	50                   	push   %eax
  800726:	ff d6                	call   *%esi
  800728:	83 c4 10             	add    $0x10,%esp
  80072b:	eb dc                	jmp    800709 <vprintfmt+0x378>
	if (lflag >= 2)
  80072d:	83 f9 01             	cmp    $0x1,%ecx
  800730:	7f 1b                	jg     80074d <vprintfmt+0x3bc>
	else if (lflag)
  800732:	85 c9                	test   %ecx,%ecx
  800734:	74 2c                	je     800762 <vprintfmt+0x3d1>
		return va_arg(*ap, unsigned long);
  800736:	8b 45 14             	mov    0x14(%ebp),%eax
  800739:	8b 10                	mov    (%eax),%edx
  80073b:	b9 00 00 00 00       	mov    $0x0,%ecx
  800740:	8d 40 04             	lea    0x4(%eax),%eax
  800743:	89 45 14             	mov    %eax,0x14(%ebp)
			base = 16;
  800746:	b8 10 00 00 00       	mov    $0x10,%eax
		return va_arg(*ap, unsigned long);
  80074b:	eb 9f                	jmp    8006ec <vprintfmt+0x35b>
		return va_arg(*ap, unsigned long long);
  80074d:	8b 45 14             	mov    0x14(%ebp),%eax
  800750:	8b 10                	mov    (%eax),%edx
  800752:	8b 48 04             	mov    0x4(%eax),%ecx
  800755:	8d 40 08             	lea    0x8(%eax),%eax
  800758:	89 45 14             	mov    %eax,0x14(%ebp)
			base = 16;
  80075b:	b8 10 00 00 00       	mov    $0x10,%eax
		return va_arg(*ap, unsigned long long);
  800760:	eb 8a                	jmp    8006ec <vprintfmt+0x35b>
		return va_arg(*ap, unsigned int);
  800762:	8b 45 14             	mov    0x14(%ebp),%eax
  800765:	8b 10                	mov    (%eax),%edx
  800767:	b9 00 00 00 00       	mov    $0x0,%ecx
  80076c:	8d 40 04             	lea    0x4(%eax),%eax
  80076f:	89 45 14             	mov    %eax,0x14(%ebp)
			base = 16;
  800772:	b8 10 00 00 00       	mov    $0x10,%eax
		return va_arg(*ap, unsigned int);
  800777:	e9 70 ff ff ff       	jmp    8006ec <vprintfmt+0x35b>
			putch(ch, putdat);
  80077c:	83 ec 08             	sub    $0x8,%esp
  80077f:	53                   	push   %ebx
  800780:	6a 25                	push   $0x25
  800782:	ff d6                	call   *%esi
			break;
  800784:	83 c4 10             	add    $0x10,%esp
  800787:	e9 7a ff ff ff       	jmp    800706 <vprintfmt+0x375>
			putch('%', putdat);
  80078c:	83 ec 08             	sub    $0x8,%esp
  80078f:	53                   	push   %ebx
  800790:	6a 25                	push   $0x25
  800792:	ff d6                	call   *%esi
			for (fmt--; fmt[-1] != '%'; fmt--)
  800794:	83 c4 10             	add    $0x10,%esp
  800797:	89 f8                	mov    %edi,%eax
  800799:	80 78 ff 25          	cmpb   $0x25,-0x1(%eax)
  80079d:	74 05                	je     8007a4 <vprintfmt+0x413>
  80079f:	83 e8 01             	sub    $0x1,%eax
  8007a2:	eb f5                	jmp    800799 <vprintfmt+0x408>
  8007a4:	89 45 e4             	mov    %eax,-0x1c(%ebp)
  8007a7:	e9 5a ff ff ff       	jmp    800706 <vprintfmt+0x375>
}
  8007ac:	8d 65 f4             	lea    -0xc(%ebp),%esp
  8007af:	5b                   	pop    %ebx
  8007b0:	5e                   	pop    %esi
  8007b1:	5f                   	pop    %edi
  8007b2:	5d                   	pop    %ebp
  8007b3:	c3                   	ret    

008007b4 <vsnprintf>:

int
vsnprintf(char *buf, int n, const char *fmt, va_list ap)
{
  8007b4:	f3 0f 1e fb          	endbr32 
  8007b8:	55                   	push   %ebp
  8007b9:	89 e5                	mov    %esp,%ebp
  8007bb:	83 ec 18             	sub    $0x18,%esp
  8007be:	8b 45 08             	mov    0x8(%ebp),%eax
  8007c1:	8b 55 0c             	mov    0xc(%ebp),%edx
	struct sprintbuf b = {buf, buf+n-1, 0};
  8007c4:	89 45 ec             	mov    %eax,-0x14(%ebp)
  8007c7:	8d 4c 10 ff          	lea    -0x1(%eax,%edx,1),%ecx
  8007cb:	89 4d f0             	mov    %ecx,-0x10(%ebp)
  8007ce:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)

	if (buf == NULL || n < 1)
  8007d5:	85 c0                	test   %eax,%eax
  8007d7:	74 26                	je     8007ff <vsnprintf+0x4b>
  8007d9:	85 d2                	test   %edx,%edx
  8007db:	7e 22                	jle    8007ff <vsnprintf+0x4b>
		return -E_INVAL;

	// print the string to the buffer
	vprintfmt((void*)sprintputch, &b, fmt, ap);
  8007dd:	ff 75 14             	pushl  0x14(%ebp)
  8007e0:	ff 75 10             	pushl  0x10(%ebp)
  8007e3:	8d 45 ec             	lea    -0x14(%ebp),%eax
  8007e6:	50                   	push   %eax
  8007e7:	68 4f 03 80 00       	push   $0x80034f
  8007ec:	e8 a0 fb ff ff       	call   800391 <vprintfmt>

	// null terminate the buffer
	*b.buf = '\0';
  8007f1:	8b 45 ec             	mov    -0x14(%ebp),%eax
  8007f4:	c6 00 00             	movb   $0x0,(%eax)

	return b.cnt;
  8007f7:	8b 45 f4             	mov    -0xc(%ebp),%eax
  8007fa:	83 c4 10             	add    $0x10,%esp
}
  8007fd:	c9                   	leave  
  8007fe:	c3                   	ret    
		return -E_INVAL;
  8007ff:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
  800804:	eb f7                	jmp    8007fd <vsnprintf+0x49>

00800806 <snprintf>:

int
snprintf(char *buf, int n, const char *fmt, ...)
{
  800806:	f3 0f 1e fb          	endbr32 
  80080a:	55                   	push   %ebp
  80080b:	89 e5                	mov    %esp,%ebp
  80080d:	83 ec 08             	sub    $0x8,%esp
	va_list ap;
	int rc;

	va_start(ap, fmt);
  800810:	8d 45 14             	lea    0x14(%ebp),%eax
	rc = vsnprintf(buf, n, fmt, ap);
  800813:	50                   	push   %eax
  800814:	ff 75 10             	pushl  0x10(%ebp)
  800817:	ff 75 0c             	pushl  0xc(%ebp)
  80081a:	ff 75 08             	pushl  0x8(%ebp)
  80081d:	e8 92 ff ff ff       	call   8007b4 <vsnprintf>
	va_end(ap);

	return rc;
}
  800822:	c9                   	leave  
  800823:	c3                   	ret    

00800824 <strlen>:
// Primespipe runs 3x faster this way.
#define ASM 1

int
strlen(const char *s)
{
  800824:	f3 0f 1e fb          	endbr32 
  800828:	55                   	push   %ebp
  800829:	89 e5                	mov    %esp,%ebp
  80082b:	8b 55 08             	mov    0x8(%ebp),%edx
	int n;

	for (n = 0; *s != '\0'; s++)
  80082e:	b8 00 00 00 00       	mov    $0x0,%eax
  800833:	80 3c 02 00          	cmpb   $0x0,(%edx,%eax,1)
  800837:	74 05                	je     80083e <strlen+0x1a>
		n++;
  800839:	83 c0 01             	add    $0x1,%eax
  80083c:	eb f5                	jmp    800833 <strlen+0xf>
	return n;
}
  80083e:	5d                   	pop    %ebp
  80083f:	c3                   	ret    

00800840 <strnlen>:

int
strnlen(const char *s, size_t size)
{
  800840:	f3 0f 1e fb          	endbr32 
  800844:	55                   	push   %ebp
  800845:	89 e5                	mov    %esp,%ebp
  800847:	8b 4d 08             	mov    0x8(%ebp),%ecx
  80084a:	8b 55 0c             	mov    0xc(%ebp),%edx
	int n;

	for (n = 0; size > 0 && *s != '\0'; s++, size--)
  80084d:	b8 00 00 00 00       	mov    $0x0,%eax
  800852:	39 d0                	cmp    %edx,%eax
  800854:	74 0d                	je     800863 <strnlen+0x23>
  800856:	80 3c 01 00          	cmpb   $0x0,(%ecx,%eax,1)
  80085a:	74 05                	je     800861 <strnlen+0x21>
		n++;
  80085c:	83 c0 01             	add    $0x1,%eax
  80085f:	eb f1                	jmp    800852 <strnlen+0x12>
  800861:	89 c2                	mov    %eax,%edx
	return n;
}
  800863:	89 d0                	mov    %edx,%eax
  800865:	5d                   	pop    %ebp
  800866:	c3                   	ret    

00800867 <strcpy>:

char *
strcpy(char *dst, const char *src)
{
  800867:	f3 0f 1e fb          	endbr32 
  80086b:	55                   	push   %ebp
  80086c:	89 e5                	mov    %esp,%ebp
  80086e:	53                   	push   %ebx
  80086f:	8b 4d 08             	mov    0x8(%ebp),%ecx
  800872:	8b 5d 0c             	mov    0xc(%ebp),%ebx
	char *ret;

	ret = dst;
	while ((*dst++ = *src++) != '\0')
  800875:	b8 00 00 00 00       	mov    $0x0,%eax
  80087a:	0f b6 14 03          	movzbl (%ebx,%eax,1),%edx
  80087e:	88 14 01             	mov    %dl,(%ecx,%eax,1)
  800881:	83 c0 01             	add    $0x1,%eax
  800884:	84 d2                	test   %dl,%dl
  800886:	75 f2                	jne    80087a <strcpy+0x13>
		/* do nothing */;
	return ret;
}
  800888:	89 c8                	mov    %ecx,%eax
  80088a:	5b                   	pop    %ebx
  80088b:	5d                   	pop    %ebp
  80088c:	c3                   	ret    

0080088d <strcat>:

char *
strcat(char *dst, const char *src)
{
  80088d:	f3 0f 1e fb          	endbr32 
  800891:	55                   	push   %ebp
  800892:	89 e5                	mov    %esp,%ebp
  800894:	53                   	push   %ebx
  800895:	83 ec 10             	sub    $0x10,%esp
  800898:	8b 5d 08             	mov    0x8(%ebp),%ebx
	int len = strlen(dst);
  80089b:	53                   	push   %ebx
  80089c:	e8 83 ff ff ff       	call   800824 <strlen>
  8008a1:	83 c4 08             	add    $0x8,%esp
	strcpy(dst + len, src);
  8008a4:	ff 75 0c             	pushl  0xc(%ebp)
  8008a7:	01 d8                	add    %ebx,%eax
  8008a9:	50                   	push   %eax
  8008aa:	e8 b8 ff ff ff       	call   800867 <strcpy>
	return dst;
}
  8008af:	89 d8                	mov    %ebx,%eax
  8008b1:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  8008b4:	c9                   	leave  
  8008b5:	c3                   	ret    

008008b6 <strncpy>:

char *
strncpy(char *dst, const char *src, size_t size) {
  8008b6:	f3 0f 1e fb          	endbr32 
  8008ba:	55                   	push   %ebp
  8008bb:	89 e5                	mov    %esp,%ebp
  8008bd:	56                   	push   %esi
  8008be:	53                   	push   %ebx
  8008bf:	8b 75 08             	mov    0x8(%ebp),%esi
  8008c2:	8b 55 0c             	mov    0xc(%ebp),%edx
  8008c5:	89 f3                	mov    %esi,%ebx
  8008c7:	03 5d 10             	add    0x10(%ebp),%ebx
	size_t i;
	char *ret;

	ret = dst;
	for (i = 0; i < size; i++) {
  8008ca:	89 f0                	mov    %esi,%eax
  8008cc:	39 d8                	cmp    %ebx,%eax
  8008ce:	74 11                	je     8008e1 <strncpy+0x2b>
		*dst++ = *src;
  8008d0:	83 c0 01             	add    $0x1,%eax
  8008d3:	0f b6 0a             	movzbl (%edx),%ecx
  8008d6:	88 48 ff             	mov    %cl,-0x1(%eax)
		// If strlen(src) < size, null-pad 'dst' out to 'size' chars
		if (*src != '\0')
			src++;
  8008d9:	80 f9 01             	cmp    $0x1,%cl
  8008dc:	83 da ff             	sbb    $0xffffffff,%edx
  8008df:	eb eb                	jmp    8008cc <strncpy+0x16>
	}
	return ret;
}
  8008e1:	89 f0                	mov    %esi,%eax
  8008e3:	5b                   	pop    %ebx
  8008e4:	5e                   	pop    %esi
  8008e5:	5d                   	pop    %ebp
  8008e6:	c3                   	ret    

008008e7 <strlcpy>:

size_t
strlcpy(char *dst, const char *src, size_t size)
{
  8008e7:	f3 0f 1e fb          	endbr32 
  8008eb:	55                   	push   %ebp
  8008ec:	89 e5                	mov    %esp,%ebp
  8008ee:	56                   	push   %esi
  8008ef:	53                   	push   %ebx
  8008f0:	8b 75 08             	mov    0x8(%ebp),%esi
  8008f3:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  8008f6:	8b 55 10             	mov    0x10(%ebp),%edx
  8008f9:	89 f0                	mov    %esi,%eax
	char *dst_in;

	dst_in = dst;
	if (size > 0) {
  8008fb:	85 d2                	test   %edx,%edx
  8008fd:	74 21                	je     800920 <strlcpy+0x39>
  8008ff:	8d 44 16 ff          	lea    -0x1(%esi,%edx,1),%eax
  800903:	89 f2                	mov    %esi,%edx
		while (--size > 0 && *src != '\0')
  800905:	39 c2                	cmp    %eax,%edx
  800907:	74 14                	je     80091d <strlcpy+0x36>
  800909:	0f b6 19             	movzbl (%ecx),%ebx
  80090c:	84 db                	test   %bl,%bl
  80090e:	74 0b                	je     80091b <strlcpy+0x34>
			*dst++ = *src++;
  800910:	83 c1 01             	add    $0x1,%ecx
  800913:	83 c2 01             	add    $0x1,%edx
  800916:	88 5a ff             	mov    %bl,-0x1(%edx)
  800919:	eb ea                	jmp    800905 <strlcpy+0x1e>
  80091b:	89 d0                	mov    %edx,%eax
		*dst = '\0';
  80091d:	c6 00 00             	movb   $0x0,(%eax)
	}
	return dst - dst_in;
  800920:	29 f0                	sub    %esi,%eax
}
  800922:	5b                   	pop    %ebx
  800923:	5e                   	pop    %esi
  800924:	5d                   	pop    %ebp
  800925:	c3                   	ret    

00800926 <strcmp>:

int
strcmp(const char *p, const char *q)
{
  800926:	f3 0f 1e fb          	endbr32 
  80092a:	55                   	push   %ebp
  80092b:	89 e5                	mov    %esp,%ebp
  80092d:	8b 4d 08             	mov    0x8(%ebp),%ecx
  800930:	8b 55 0c             	mov    0xc(%ebp),%edx
	while (*p && *p == *q)
  800933:	0f b6 01             	movzbl (%ecx),%eax
  800936:	84 c0                	test   %al,%al
  800938:	74 0c                	je     800946 <strcmp+0x20>
  80093a:	3a 02                	cmp    (%edx),%al
  80093c:	75 08                	jne    800946 <strcmp+0x20>
		p++, q++;
  80093e:	83 c1 01             	add    $0x1,%ecx
  800941:	83 c2 01             	add    $0x1,%edx
  800944:	eb ed                	jmp    800933 <strcmp+0xd>
	return (int) ((unsigned char) *p - (unsigned char) *q);
  800946:	0f b6 c0             	movzbl %al,%eax
  800949:	0f b6 12             	movzbl (%edx),%edx
  80094c:	29 d0                	sub    %edx,%eax
}
  80094e:	5d                   	pop    %ebp
  80094f:	c3                   	ret    

00800950 <strncmp>:

int
strncmp(const char *p, const char *q, size_t n)
{
  800950:	f3 0f 1e fb          	endbr32 
  800954:	55                   	push   %ebp
  800955:	89 e5                	mov    %esp,%ebp
  800957:	53                   	push   %ebx
  800958:	8b 45 08             	mov    0x8(%ebp),%eax
  80095b:	8b 55 0c             	mov    0xc(%ebp),%edx
  80095e:	89 c3                	mov    %eax,%ebx
  800960:	03 5d 10             	add    0x10(%ebp),%ebx
	while (n > 0 && *p && *p == *q)
  800963:	eb 06                	jmp    80096b <strncmp+0x1b>
		n--, p++, q++;
  800965:	83 c0 01             	add    $0x1,%eax
  800968:	83 c2 01             	add    $0x1,%edx
	while (n > 0 && *p && *p == *q)
  80096b:	39 d8                	cmp    %ebx,%eax
  80096d:	74 16                	je     800985 <strncmp+0x35>
  80096f:	0f b6 08             	movzbl (%eax),%ecx
  800972:	84 c9                	test   %cl,%cl
  800974:	74 04                	je     80097a <strncmp+0x2a>
  800976:	3a 0a                	cmp    (%edx),%cl
  800978:	74 eb                	je     800965 <strncmp+0x15>
	if (n == 0)
		return 0;
	else
		return (int) ((unsigned char) *p - (unsigned char) *q);
  80097a:	0f b6 00             	movzbl (%eax),%eax
  80097d:	0f b6 12             	movzbl (%edx),%edx
  800980:	29 d0                	sub    %edx,%eax
}
  800982:	5b                   	pop    %ebx
  800983:	5d                   	pop    %ebp
  800984:	c3                   	ret    
		return 0;
  800985:	b8 00 00 00 00       	mov    $0x0,%eax
  80098a:	eb f6                	jmp    800982 <strncmp+0x32>

0080098c <strchr>:

// Return a pointer to the first occurrence of 'c' in 's',
// or a null pointer if the string has no 'c'.
char *
strchr(const char *s, char c)
{
  80098c:	f3 0f 1e fb          	endbr32 
  800990:	55                   	push   %ebp
  800991:	89 e5                	mov    %esp,%ebp
  800993:	8b 45 08             	mov    0x8(%ebp),%eax
  800996:	0f b6 4d 0c          	movzbl 0xc(%ebp),%ecx
	for (; *s; s++)
  80099a:	0f b6 10             	movzbl (%eax),%edx
  80099d:	84 d2                	test   %dl,%dl
  80099f:	74 09                	je     8009aa <strchr+0x1e>
		if (*s == c)
  8009a1:	38 ca                	cmp    %cl,%dl
  8009a3:	74 0a                	je     8009af <strchr+0x23>
	for (; *s; s++)
  8009a5:	83 c0 01             	add    $0x1,%eax
  8009a8:	eb f0                	jmp    80099a <strchr+0xe>
			return (char *) s;
	return 0;
  8009aa:	b8 00 00 00 00       	mov    $0x0,%eax
}
  8009af:	5d                   	pop    %ebp
  8009b0:	c3                   	ret    

008009b1 <strfind>:

// Return a pointer to the first occurrence of 'c' in 's',
// or a pointer to the string-ending null character if the string has no 'c'.
char *
strfind(const char *s, char c)
{
  8009b1:	f3 0f 1e fb          	endbr32 
  8009b5:	55                   	push   %ebp
  8009b6:	89 e5                	mov    %esp,%ebp
  8009b8:	8b 45 08             	mov    0x8(%ebp),%eax
  8009bb:	0f b6 4d 0c          	movzbl 0xc(%ebp),%ecx
	for (; *s; s++)
  8009bf:	0f b6 10             	movzbl (%eax),%edx
		if (*s == c)
  8009c2:	38 ca                	cmp    %cl,%dl
  8009c4:	74 09                	je     8009cf <strfind+0x1e>
  8009c6:	84 d2                	test   %dl,%dl
  8009c8:	74 05                	je     8009cf <strfind+0x1e>
	for (; *s; s++)
  8009ca:	83 c0 01             	add    $0x1,%eax
  8009cd:	eb f0                	jmp    8009bf <strfind+0xe>
			break;
	return (char *) s;
}
  8009cf:	5d                   	pop    %ebp
  8009d0:	c3                   	ret    

008009d1 <memset>:

#if ASM
void *
memset(void *v, int c, size_t n)
{
  8009d1:	f3 0f 1e fb          	endbr32 
  8009d5:	55                   	push   %ebp
  8009d6:	89 e5                	mov    %esp,%ebp
  8009d8:	57                   	push   %edi
  8009d9:	56                   	push   %esi
  8009da:	53                   	push   %ebx
  8009db:	8b 7d 08             	mov    0x8(%ebp),%edi
  8009de:	8b 4d 10             	mov    0x10(%ebp),%ecx
	char *p;

	if (n == 0)
  8009e1:	85 c9                	test   %ecx,%ecx
  8009e3:	74 31                	je     800a16 <memset+0x45>
		return v;
	if ((int)v%4 == 0 && n%4 == 0) {
  8009e5:	89 f8                	mov    %edi,%eax
  8009e7:	09 c8                	or     %ecx,%eax
  8009e9:	a8 03                	test   $0x3,%al
  8009eb:	75 23                	jne    800a10 <memset+0x3f>
		c &= 0xFF;
  8009ed:	0f b6 55 0c          	movzbl 0xc(%ebp),%edx
		c = (c<<24)|(c<<16)|(c<<8)|c;
  8009f1:	89 d3                	mov    %edx,%ebx
  8009f3:	c1 e3 08             	shl    $0x8,%ebx
  8009f6:	89 d0                	mov    %edx,%eax
  8009f8:	c1 e0 18             	shl    $0x18,%eax
  8009fb:	89 d6                	mov    %edx,%esi
  8009fd:	c1 e6 10             	shl    $0x10,%esi
  800a00:	09 f0                	or     %esi,%eax
  800a02:	09 c2                	or     %eax,%edx
  800a04:	09 da                	or     %ebx,%edx
		asm volatile("cld; rep stosl\n"
			:: "D" (v), "a" (c), "c" (n/4)
  800a06:	c1 e9 02             	shr    $0x2,%ecx
		asm volatile("cld; rep stosl\n"
  800a09:	89 d0                	mov    %edx,%eax
  800a0b:	fc                   	cld    
  800a0c:	f3 ab                	rep stos %eax,%es:(%edi)
  800a0e:	eb 06                	jmp    800a16 <memset+0x45>
			: "cc", "memory");
	} else
		asm volatile("cld; rep stosb\n"
  800a10:	8b 45 0c             	mov    0xc(%ebp),%eax
  800a13:	fc                   	cld    
  800a14:	f3 aa                	rep stos %al,%es:(%edi)
			:: "D" (v), "a" (c), "c" (n)
			: "cc", "memory");
	return v;
}
  800a16:	89 f8                	mov    %edi,%eax
  800a18:	5b                   	pop    %ebx
  800a19:	5e                   	pop    %esi
  800a1a:	5f                   	pop    %edi
  800a1b:	5d                   	pop    %ebp
  800a1c:	c3                   	ret    

00800a1d <memmove>:

void *
memmove(void *dst, const void *src, size_t n)
{
  800a1d:	f3 0f 1e fb          	endbr32 
  800a21:	55                   	push   %ebp
  800a22:	89 e5                	mov    %esp,%ebp
  800a24:	57                   	push   %edi
  800a25:	56                   	push   %esi
  800a26:	8b 45 08             	mov    0x8(%ebp),%eax
  800a29:	8b 75 0c             	mov    0xc(%ebp),%esi
  800a2c:	8b 4d 10             	mov    0x10(%ebp),%ecx
	const char *s;
	char *d;

	s = src;
	d = dst;
	if (s < d && s + n > d) {
  800a2f:	39 c6                	cmp    %eax,%esi
  800a31:	73 32                	jae    800a65 <memmove+0x48>
  800a33:	8d 14 0e             	lea    (%esi,%ecx,1),%edx
  800a36:	39 c2                	cmp    %eax,%edx
  800a38:	76 2b                	jbe    800a65 <memmove+0x48>
		s += n;
		d += n;
  800a3a:	8d 3c 08             	lea    (%eax,%ecx,1),%edi
		if ((int)s%4 == 0 && (int)d%4 == 0 && n%4 == 0)
  800a3d:	89 fe                	mov    %edi,%esi
  800a3f:	09 ce                	or     %ecx,%esi
  800a41:	09 d6                	or     %edx,%esi
  800a43:	f7 c6 03 00 00 00    	test   $0x3,%esi
  800a49:	75 0e                	jne    800a59 <memmove+0x3c>
			asm volatile("std; rep movsl\n"
				:: "D" (d-4), "S" (s-4), "c" (n/4) : "cc", "memory");
  800a4b:	83 ef 04             	sub    $0x4,%edi
  800a4e:	8d 72 fc             	lea    -0x4(%edx),%esi
  800a51:	c1 e9 02             	shr    $0x2,%ecx
			asm volatile("std; rep movsl\n"
  800a54:	fd                   	std    
  800a55:	f3 a5                	rep movsl %ds:(%esi),%es:(%edi)
  800a57:	eb 09                	jmp    800a62 <memmove+0x45>
		else
			asm volatile("std; rep movsb\n"
				:: "D" (d-1), "S" (s-1), "c" (n) : "cc", "memory");
  800a59:	83 ef 01             	sub    $0x1,%edi
  800a5c:	8d 72 ff             	lea    -0x1(%edx),%esi
			asm volatile("std; rep movsb\n"
  800a5f:	fd                   	std    
  800a60:	f3 a4                	rep movsb %ds:(%esi),%es:(%edi)
		// Some versions of GCC rely on DF being clear
		asm volatile("cld" ::: "cc");
  800a62:	fc                   	cld    
  800a63:	eb 1a                	jmp    800a7f <memmove+0x62>
	} else {
		if ((int)s%4 == 0 && (int)d%4 == 0 && n%4 == 0)
  800a65:	89 c2                	mov    %eax,%edx
  800a67:	09 ca                	or     %ecx,%edx
  800a69:	09 f2                	or     %esi,%edx
  800a6b:	f6 c2 03             	test   $0x3,%dl
  800a6e:	75 0a                	jne    800a7a <memmove+0x5d>
			asm volatile("cld; rep movsl\n"
				:: "D" (d), "S" (s), "c" (n/4) : "cc", "memory");
  800a70:	c1 e9 02             	shr    $0x2,%ecx
			asm volatile("cld; rep movsl\n"
  800a73:	89 c7                	mov    %eax,%edi
  800a75:	fc                   	cld    
  800a76:	f3 a5                	rep movsl %ds:(%esi),%es:(%edi)
  800a78:	eb 05                	jmp    800a7f <memmove+0x62>
		else
			asm volatile("cld; rep movsb\n"
  800a7a:	89 c7                	mov    %eax,%edi
  800a7c:	fc                   	cld    
  800a7d:	f3 a4                	rep movsb %ds:(%esi),%es:(%edi)
				:: "D" (d), "S" (s), "c" (n) : "cc", "memory");
	}
	return dst;
}
  800a7f:	5e                   	pop    %esi
  800a80:	5f                   	pop    %edi
  800a81:	5d                   	pop    %ebp
  800a82:	c3                   	ret    

00800a83 <memcpy>:
}
#endif

void *
memcpy(void *dst, const void *src, size_t n)
{
  800a83:	f3 0f 1e fb          	endbr32 
  800a87:	55                   	push   %ebp
  800a88:	89 e5                	mov    %esp,%ebp
  800a8a:	83 ec 0c             	sub    $0xc,%esp
	return memmove(dst, src, n);
  800a8d:	ff 75 10             	pushl  0x10(%ebp)
  800a90:	ff 75 0c             	pushl  0xc(%ebp)
  800a93:	ff 75 08             	pushl  0x8(%ebp)
  800a96:	e8 82 ff ff ff       	call   800a1d <memmove>
}
  800a9b:	c9                   	leave  
  800a9c:	c3                   	ret    

00800a9d <memcmp>:

int
memcmp(const void *v1, const void *v2, size_t n)
{
  800a9d:	f3 0f 1e fb          	endbr32 
  800aa1:	55                   	push   %ebp
  800aa2:	89 e5                	mov    %esp,%ebp
  800aa4:	56                   	push   %esi
  800aa5:	53                   	push   %ebx
  800aa6:	8b 45 08             	mov    0x8(%ebp),%eax
  800aa9:	8b 55 0c             	mov    0xc(%ebp),%edx
  800aac:	89 c6                	mov    %eax,%esi
  800aae:	03 75 10             	add    0x10(%ebp),%esi
	const uint8_t *s1 = (const uint8_t *) v1;
	const uint8_t *s2 = (const uint8_t *) v2;

	while (n-- > 0) {
  800ab1:	39 f0                	cmp    %esi,%eax
  800ab3:	74 1c                	je     800ad1 <memcmp+0x34>
		if (*s1 != *s2)
  800ab5:	0f b6 08             	movzbl (%eax),%ecx
  800ab8:	0f b6 1a             	movzbl (%edx),%ebx
  800abb:	38 d9                	cmp    %bl,%cl
  800abd:	75 08                	jne    800ac7 <memcmp+0x2a>
			return (int) *s1 - (int) *s2;
		s1++, s2++;
  800abf:	83 c0 01             	add    $0x1,%eax
  800ac2:	83 c2 01             	add    $0x1,%edx
  800ac5:	eb ea                	jmp    800ab1 <memcmp+0x14>
			return (int) *s1 - (int) *s2;
  800ac7:	0f b6 c1             	movzbl %cl,%eax
  800aca:	0f b6 db             	movzbl %bl,%ebx
  800acd:	29 d8                	sub    %ebx,%eax
  800acf:	eb 05                	jmp    800ad6 <memcmp+0x39>
	}

	return 0;
  800ad1:	b8 00 00 00 00       	mov    $0x0,%eax
}
  800ad6:	5b                   	pop    %ebx
  800ad7:	5e                   	pop    %esi
  800ad8:	5d                   	pop    %ebp
  800ad9:	c3                   	ret    

00800ada <memfind>:

void *
memfind(const void *s, int c, size_t n)
{
  800ada:	f3 0f 1e fb          	endbr32 
  800ade:	55                   	push   %ebp
  800adf:	89 e5                	mov    %esp,%ebp
  800ae1:	8b 45 08             	mov    0x8(%ebp),%eax
  800ae4:	8b 4d 0c             	mov    0xc(%ebp),%ecx
	const void *ends = (const char *) s + n;
  800ae7:	89 c2                	mov    %eax,%edx
  800ae9:	03 55 10             	add    0x10(%ebp),%edx
	for (; s < ends; s++)
  800aec:	39 d0                	cmp    %edx,%eax
  800aee:	73 09                	jae    800af9 <memfind+0x1f>
		if (*(const unsigned char *) s == (unsigned char) c)
  800af0:	38 08                	cmp    %cl,(%eax)
  800af2:	74 05                	je     800af9 <memfind+0x1f>
	for (; s < ends; s++)
  800af4:	83 c0 01             	add    $0x1,%eax
  800af7:	eb f3                	jmp    800aec <memfind+0x12>
			break;
	return (void *) s;
}
  800af9:	5d                   	pop    %ebp
  800afa:	c3                   	ret    

00800afb <strtol>:

long
strtol(const char *s, char **endptr, int base)
{
  800afb:	f3 0f 1e fb          	endbr32 
  800aff:	55                   	push   %ebp
  800b00:	89 e5                	mov    %esp,%ebp
  800b02:	57                   	push   %edi
  800b03:	56                   	push   %esi
  800b04:	53                   	push   %ebx
  800b05:	8b 4d 08             	mov    0x8(%ebp),%ecx
  800b08:	8b 5d 10             	mov    0x10(%ebp),%ebx
	int neg = 0;
	long val = 0;

	// gobble initial whitespace
	while (*s == ' ' || *s == '\t')
  800b0b:	eb 03                	jmp    800b10 <strtol+0x15>
		s++;
  800b0d:	83 c1 01             	add    $0x1,%ecx
	while (*s == ' ' || *s == '\t')
  800b10:	0f b6 01             	movzbl (%ecx),%eax
  800b13:	3c 20                	cmp    $0x20,%al
  800b15:	74 f6                	je     800b0d <strtol+0x12>
  800b17:	3c 09                	cmp    $0x9,%al
  800b19:	74 f2                	je     800b0d <strtol+0x12>

	// plus/minus sign
	if (*s == '+')
  800b1b:	3c 2b                	cmp    $0x2b,%al
  800b1d:	74 2a                	je     800b49 <strtol+0x4e>
	int neg = 0;
  800b1f:	bf 00 00 00 00       	mov    $0x0,%edi
		s++;
	else if (*s == '-')
  800b24:	3c 2d                	cmp    $0x2d,%al
  800b26:	74 2b                	je     800b53 <strtol+0x58>
		s++, neg = 1;

	// hex or octal base prefix
	if ((base == 0 || base == 16) && (s[0] == '0' && s[1] == 'x'))
  800b28:	f7 c3 ef ff ff ff    	test   $0xffffffef,%ebx
  800b2e:	75 0f                	jne    800b3f <strtol+0x44>
  800b30:	80 39 30             	cmpb   $0x30,(%ecx)
  800b33:	74 28                	je     800b5d <strtol+0x62>
		s += 2, base = 16;
	else if (base == 0 && s[0] == '0')
		s++, base = 8;
	else if (base == 0)
		base = 10;
  800b35:	85 db                	test   %ebx,%ebx
  800b37:	b8 0a 00 00 00       	mov    $0xa,%eax
  800b3c:	0f 44 d8             	cmove  %eax,%ebx
  800b3f:	b8 00 00 00 00       	mov    $0x0,%eax
  800b44:	89 5d 10             	mov    %ebx,0x10(%ebp)
  800b47:	eb 46                	jmp    800b8f <strtol+0x94>
		s++;
  800b49:	83 c1 01             	add    $0x1,%ecx
	int neg = 0;
  800b4c:	bf 00 00 00 00       	mov    $0x0,%edi
  800b51:	eb d5                	jmp    800b28 <strtol+0x2d>
		s++, neg = 1;
  800b53:	83 c1 01             	add    $0x1,%ecx
  800b56:	bf 01 00 00 00       	mov    $0x1,%edi
  800b5b:	eb cb                	jmp    800b28 <strtol+0x2d>
	if ((base == 0 || base == 16) && (s[0] == '0' && s[1] == 'x'))
  800b5d:	80 79 01 78          	cmpb   $0x78,0x1(%ecx)
  800b61:	74 0e                	je     800b71 <strtol+0x76>
	else if (base == 0 && s[0] == '0')
  800b63:	85 db                	test   %ebx,%ebx
  800b65:	75 d8                	jne    800b3f <strtol+0x44>
		s++, base = 8;
  800b67:	83 c1 01             	add    $0x1,%ecx
  800b6a:	bb 08 00 00 00       	mov    $0x8,%ebx
  800b6f:	eb ce                	jmp    800b3f <strtol+0x44>
		s += 2, base = 16;
  800b71:	83 c1 02             	add    $0x2,%ecx
  800b74:	bb 10 00 00 00       	mov    $0x10,%ebx
  800b79:	eb c4                	jmp    800b3f <strtol+0x44>
	// digits
	while (1) {
		int dig;

		if (*s >= '0' && *s <= '9')
			dig = *s - '0';
  800b7b:	0f be d2             	movsbl %dl,%edx
  800b7e:	83 ea 30             	sub    $0x30,%edx
			dig = *s - 'a' + 10;
		else if (*s >= 'A' && *s <= 'Z')
			dig = *s - 'A' + 10;
		else
			break;
		if (dig >= base)
  800b81:	3b 55 10             	cmp    0x10(%ebp),%edx
  800b84:	7d 3a                	jge    800bc0 <strtol+0xc5>
			break;
		s++, val = (val * base) + dig;
  800b86:	83 c1 01             	add    $0x1,%ecx
  800b89:	0f af 45 10          	imul   0x10(%ebp),%eax
  800b8d:	01 d0                	add    %edx,%eax
		if (*s >= '0' && *s <= '9')
  800b8f:	0f b6 11             	movzbl (%ecx),%edx
  800b92:	8d 72 d0             	lea    -0x30(%edx),%esi
  800b95:	89 f3                	mov    %esi,%ebx
  800b97:	80 fb 09             	cmp    $0x9,%bl
  800b9a:	76 df                	jbe    800b7b <strtol+0x80>
		else if (*s >= 'a' && *s <= 'z')
  800b9c:	8d 72 9f             	lea    -0x61(%edx),%esi
  800b9f:	89 f3                	mov    %esi,%ebx
  800ba1:	80 fb 19             	cmp    $0x19,%bl
  800ba4:	77 08                	ja     800bae <strtol+0xb3>
			dig = *s - 'a' + 10;
  800ba6:	0f be d2             	movsbl %dl,%edx
  800ba9:	83 ea 57             	sub    $0x57,%edx
  800bac:	eb d3                	jmp    800b81 <strtol+0x86>
		else if (*s >= 'A' && *s <= 'Z')
  800bae:	8d 72 bf             	lea    -0x41(%edx),%esi
  800bb1:	89 f3                	mov    %esi,%ebx
  800bb3:	80 fb 19             	cmp    $0x19,%bl
  800bb6:	77 08                	ja     800bc0 <strtol+0xc5>
			dig = *s - 'A' + 10;
  800bb8:	0f be d2             	movsbl %dl,%edx
  800bbb:	83 ea 37             	sub    $0x37,%edx
  800bbe:	eb c1                	jmp    800b81 <strtol+0x86>
		// we don't properly detect overflow!
	}

	if (endptr)
  800bc0:	83 7d 0c 00          	cmpl   $0x0,0xc(%ebp)
  800bc4:	74 05                	je     800bcb <strtol+0xd0>
		*endptr = (char *) s;
  800bc6:	8b 75 0c             	mov    0xc(%ebp),%esi
  800bc9:	89 0e                	mov    %ecx,(%esi)
	return (neg ? -val : val);
  800bcb:	89 c2                	mov    %eax,%edx
  800bcd:	f7 da                	neg    %edx
  800bcf:	85 ff                	test   %edi,%edi
  800bd1:	0f 45 c2             	cmovne %edx,%eax
}
  800bd4:	5b                   	pop    %ebx
  800bd5:	5e                   	pop    %esi
  800bd6:	5f                   	pop    %edi
  800bd7:	5d                   	pop    %ebp
  800bd8:	c3                   	ret    

00800bd9 <sys_cputs>:
	return ret;
}

void
sys_cputs(const char *s, size_t len)
{
  800bd9:	f3 0f 1e fb          	endbr32 
  800bdd:	55                   	push   %ebp
  800bde:	89 e5                	mov    %esp,%ebp
  800be0:	57                   	push   %edi
  800be1:	56                   	push   %esi
  800be2:	53                   	push   %ebx
	asm volatile("int %1\n"
  800be3:	b8 00 00 00 00       	mov    $0x0,%eax
  800be8:	8b 55 08             	mov    0x8(%ebp),%edx
  800beb:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  800bee:	89 c3                	mov    %eax,%ebx
  800bf0:	89 c7                	mov    %eax,%edi
  800bf2:	89 c6                	mov    %eax,%esi
  800bf4:	cd 30                	int    $0x30
	syscall(SYS_cputs, 0, (uint32_t)s, len, 0, 0, 0);
}
  800bf6:	5b                   	pop    %ebx
  800bf7:	5e                   	pop    %esi
  800bf8:	5f                   	pop    %edi
  800bf9:	5d                   	pop    %ebp
  800bfa:	c3                   	ret    

00800bfb <sys_cgetc>:

int
sys_cgetc(void)
{
  800bfb:	f3 0f 1e fb          	endbr32 
  800bff:	55                   	push   %ebp
  800c00:	89 e5                	mov    %esp,%ebp
  800c02:	57                   	push   %edi
  800c03:	56                   	push   %esi
  800c04:	53                   	push   %ebx
	asm volatile("int %1\n"
  800c05:	ba 00 00 00 00       	mov    $0x0,%edx
  800c0a:	b8 01 00 00 00       	mov    $0x1,%eax
  800c0f:	89 d1                	mov    %edx,%ecx
  800c11:	89 d3                	mov    %edx,%ebx
  800c13:	89 d7                	mov    %edx,%edi
  800c15:	89 d6                	mov    %edx,%esi
  800c17:	cd 30                	int    $0x30
	return syscall(SYS_cgetc, 0, 0, 0, 0, 0, 0);
}
  800c19:	5b                   	pop    %ebx
  800c1a:	5e                   	pop    %esi
  800c1b:	5f                   	pop    %edi
  800c1c:	5d                   	pop    %ebp
  800c1d:	c3                   	ret    

00800c1e <sys_env_destroy>:

int
sys_env_destroy(envid_t envid)
{
  800c1e:	f3 0f 1e fb          	endbr32 
  800c22:	55                   	push   %ebp
  800c23:	89 e5                	mov    %esp,%ebp
  800c25:	57                   	push   %edi
  800c26:	56                   	push   %esi
  800c27:	53                   	push   %ebx
  800c28:	83 ec 0c             	sub    $0xc,%esp
	asm volatile("int %1\n"
  800c2b:	b9 00 00 00 00       	mov    $0x0,%ecx
  800c30:	8b 55 08             	mov    0x8(%ebp),%edx
  800c33:	b8 03 00 00 00       	mov    $0x3,%eax
  800c38:	89 cb                	mov    %ecx,%ebx
  800c3a:	89 cf                	mov    %ecx,%edi
  800c3c:	89 ce                	mov    %ecx,%esi
  800c3e:	cd 30                	int    $0x30
	if(check && ret > 0)
  800c40:	85 c0                	test   %eax,%eax
  800c42:	7f 08                	jg     800c4c <sys_env_destroy+0x2e>
	return syscall(SYS_env_destroy, 1, envid, 0, 0, 0, 0);
}
  800c44:	8d 65 f4             	lea    -0xc(%ebp),%esp
  800c47:	5b                   	pop    %ebx
  800c48:	5e                   	pop    %esi
  800c49:	5f                   	pop    %edi
  800c4a:	5d                   	pop    %ebp
  800c4b:	c3                   	ret    
		panic("syscall %d returned %d (> 0)", num, ret);
  800c4c:	83 ec 0c             	sub    $0xc,%esp
  800c4f:	50                   	push   %eax
  800c50:	6a 03                	push   $0x3
  800c52:	68 5f 24 80 00       	push   $0x80245f
  800c57:	6a 23                	push   $0x23
  800c59:	68 7c 24 80 00       	push   $0x80247c
  800c5e:	e8 44 f5 ff ff       	call   8001a7 <_panic>

00800c63 <sys_getenvid>:

envid_t
sys_getenvid(void)
{
  800c63:	f3 0f 1e fb          	endbr32 
  800c67:	55                   	push   %ebp
  800c68:	89 e5                	mov    %esp,%ebp
  800c6a:	57                   	push   %edi
  800c6b:	56                   	push   %esi
  800c6c:	53                   	push   %ebx
	asm volatile("int %1\n"
  800c6d:	ba 00 00 00 00       	mov    $0x0,%edx
  800c72:	b8 02 00 00 00       	mov    $0x2,%eax
  800c77:	89 d1                	mov    %edx,%ecx
  800c79:	89 d3                	mov    %edx,%ebx
  800c7b:	89 d7                	mov    %edx,%edi
  800c7d:	89 d6                	mov    %edx,%esi
  800c7f:	cd 30                	int    $0x30
	 return syscall(SYS_getenvid, 0, 0, 0, 0, 0, 0);
}
  800c81:	5b                   	pop    %ebx
  800c82:	5e                   	pop    %esi
  800c83:	5f                   	pop    %edi
  800c84:	5d                   	pop    %ebp
  800c85:	c3                   	ret    

00800c86 <sys_yield>:

void
sys_yield(void)
{
  800c86:	f3 0f 1e fb          	endbr32 
  800c8a:	55                   	push   %ebp
  800c8b:	89 e5                	mov    %esp,%ebp
  800c8d:	57                   	push   %edi
  800c8e:	56                   	push   %esi
  800c8f:	53                   	push   %ebx
	asm volatile("int %1\n"
  800c90:	ba 00 00 00 00       	mov    $0x0,%edx
  800c95:	b8 0b 00 00 00       	mov    $0xb,%eax
  800c9a:	89 d1                	mov    %edx,%ecx
  800c9c:	89 d3                	mov    %edx,%ebx
  800c9e:	89 d7                	mov    %edx,%edi
  800ca0:	89 d6                	mov    %edx,%esi
  800ca2:	cd 30                	int    $0x30
	syscall(SYS_yield, 0, 0, 0, 0, 0, 0);
}
  800ca4:	5b                   	pop    %ebx
  800ca5:	5e                   	pop    %esi
  800ca6:	5f                   	pop    %edi
  800ca7:	5d                   	pop    %ebp
  800ca8:	c3                   	ret    

00800ca9 <sys_page_alloc>:

int
sys_page_alloc(envid_t envid, void *va, int perm)
{
  800ca9:	f3 0f 1e fb          	endbr32 
  800cad:	55                   	push   %ebp
  800cae:	89 e5                	mov    %esp,%ebp
  800cb0:	57                   	push   %edi
  800cb1:	56                   	push   %esi
  800cb2:	53                   	push   %ebx
  800cb3:	83 ec 0c             	sub    $0xc,%esp
	asm volatile("int %1\n"
  800cb6:	be 00 00 00 00       	mov    $0x0,%esi
  800cbb:	8b 55 08             	mov    0x8(%ebp),%edx
  800cbe:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  800cc1:	b8 04 00 00 00       	mov    $0x4,%eax
  800cc6:	8b 5d 10             	mov    0x10(%ebp),%ebx
  800cc9:	89 f7                	mov    %esi,%edi
  800ccb:	cd 30                	int    $0x30
	if(check && ret > 0)
  800ccd:	85 c0                	test   %eax,%eax
  800ccf:	7f 08                	jg     800cd9 <sys_page_alloc+0x30>
	return syscall(SYS_page_alloc, 1, envid, (uint32_t) va, perm, 0, 0);
}
  800cd1:	8d 65 f4             	lea    -0xc(%ebp),%esp
  800cd4:	5b                   	pop    %ebx
  800cd5:	5e                   	pop    %esi
  800cd6:	5f                   	pop    %edi
  800cd7:	5d                   	pop    %ebp
  800cd8:	c3                   	ret    
		panic("syscall %d returned %d (> 0)", num, ret);
  800cd9:	83 ec 0c             	sub    $0xc,%esp
  800cdc:	50                   	push   %eax
  800cdd:	6a 04                	push   $0x4
  800cdf:	68 5f 24 80 00       	push   $0x80245f
  800ce4:	6a 23                	push   $0x23
  800ce6:	68 7c 24 80 00       	push   $0x80247c
  800ceb:	e8 b7 f4 ff ff       	call   8001a7 <_panic>

00800cf0 <sys_page_map>:

int
sys_page_map(envid_t srcenv, void *srcva, envid_t dstenv, void *dstva, int perm)
{
  800cf0:	f3 0f 1e fb          	endbr32 
  800cf4:	55                   	push   %ebp
  800cf5:	89 e5                	mov    %esp,%ebp
  800cf7:	57                   	push   %edi
  800cf8:	56                   	push   %esi
  800cf9:	53                   	push   %ebx
  800cfa:	83 ec 0c             	sub    $0xc,%esp
	asm volatile("int %1\n"
  800cfd:	8b 55 08             	mov    0x8(%ebp),%edx
  800d00:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  800d03:	b8 05 00 00 00       	mov    $0x5,%eax
  800d08:	8b 5d 10             	mov    0x10(%ebp),%ebx
  800d0b:	8b 7d 14             	mov    0x14(%ebp),%edi
  800d0e:	8b 75 18             	mov    0x18(%ebp),%esi
  800d11:	cd 30                	int    $0x30
	if(check && ret > 0)
  800d13:	85 c0                	test   %eax,%eax
  800d15:	7f 08                	jg     800d1f <sys_page_map+0x2f>
	return syscall(SYS_page_map, 1, srcenv, (uint32_t) srcva, dstenv, (uint32_t) dstva, perm);
}
  800d17:	8d 65 f4             	lea    -0xc(%ebp),%esp
  800d1a:	5b                   	pop    %ebx
  800d1b:	5e                   	pop    %esi
  800d1c:	5f                   	pop    %edi
  800d1d:	5d                   	pop    %ebp
  800d1e:	c3                   	ret    
		panic("syscall %d returned %d (> 0)", num, ret);
  800d1f:	83 ec 0c             	sub    $0xc,%esp
  800d22:	50                   	push   %eax
  800d23:	6a 05                	push   $0x5
  800d25:	68 5f 24 80 00       	push   $0x80245f
  800d2a:	6a 23                	push   $0x23
  800d2c:	68 7c 24 80 00       	push   $0x80247c
  800d31:	e8 71 f4 ff ff       	call   8001a7 <_panic>

00800d36 <sys_page_unmap>:

int
sys_page_unmap(envid_t envid, void *va)
{
  800d36:	f3 0f 1e fb          	endbr32 
  800d3a:	55                   	push   %ebp
  800d3b:	89 e5                	mov    %esp,%ebp
  800d3d:	57                   	push   %edi
  800d3e:	56                   	push   %esi
  800d3f:	53                   	push   %ebx
  800d40:	83 ec 0c             	sub    $0xc,%esp
	asm volatile("int %1\n"
  800d43:	bb 00 00 00 00       	mov    $0x0,%ebx
  800d48:	8b 55 08             	mov    0x8(%ebp),%edx
  800d4b:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  800d4e:	b8 06 00 00 00       	mov    $0x6,%eax
  800d53:	89 df                	mov    %ebx,%edi
  800d55:	89 de                	mov    %ebx,%esi
  800d57:	cd 30                	int    $0x30
	if(check && ret > 0)
  800d59:	85 c0                	test   %eax,%eax
  800d5b:	7f 08                	jg     800d65 <sys_page_unmap+0x2f>
	return syscall(SYS_page_unmap, 1, envid, (uint32_t) va, 0, 0, 0);
}
  800d5d:	8d 65 f4             	lea    -0xc(%ebp),%esp
  800d60:	5b                   	pop    %ebx
  800d61:	5e                   	pop    %esi
  800d62:	5f                   	pop    %edi
  800d63:	5d                   	pop    %ebp
  800d64:	c3                   	ret    
		panic("syscall %d returned %d (> 0)", num, ret);
  800d65:	83 ec 0c             	sub    $0xc,%esp
  800d68:	50                   	push   %eax
  800d69:	6a 06                	push   $0x6
  800d6b:	68 5f 24 80 00       	push   $0x80245f
  800d70:	6a 23                	push   $0x23
  800d72:	68 7c 24 80 00       	push   $0x80247c
  800d77:	e8 2b f4 ff ff       	call   8001a7 <_panic>

00800d7c <sys_env_set_status>:

// sys_exofork is inlined in lib.h

int
sys_env_set_status(envid_t envid, int status)
{
  800d7c:	f3 0f 1e fb          	endbr32 
  800d80:	55                   	push   %ebp
  800d81:	89 e5                	mov    %esp,%ebp
  800d83:	57                   	push   %edi
  800d84:	56                   	push   %esi
  800d85:	53                   	push   %ebx
  800d86:	83 ec 0c             	sub    $0xc,%esp
	asm volatile("int %1\n"
  800d89:	bb 00 00 00 00       	mov    $0x0,%ebx
  800d8e:	8b 55 08             	mov    0x8(%ebp),%edx
  800d91:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  800d94:	b8 08 00 00 00       	mov    $0x8,%eax
  800d99:	89 df                	mov    %ebx,%edi
  800d9b:	89 de                	mov    %ebx,%esi
  800d9d:	cd 30                	int    $0x30
	if(check && ret > 0)
  800d9f:	85 c0                	test   %eax,%eax
  800da1:	7f 08                	jg     800dab <sys_env_set_status+0x2f>
	return syscall(SYS_env_set_status, 1, envid, status, 0, 0, 0);
}
  800da3:	8d 65 f4             	lea    -0xc(%ebp),%esp
  800da6:	5b                   	pop    %ebx
  800da7:	5e                   	pop    %esi
  800da8:	5f                   	pop    %edi
  800da9:	5d                   	pop    %ebp
  800daa:	c3                   	ret    
		panic("syscall %d returned %d (> 0)", num, ret);
  800dab:	83 ec 0c             	sub    $0xc,%esp
  800dae:	50                   	push   %eax
  800daf:	6a 08                	push   $0x8
  800db1:	68 5f 24 80 00       	push   $0x80245f
  800db6:	6a 23                	push   $0x23
  800db8:	68 7c 24 80 00       	push   $0x80247c
  800dbd:	e8 e5 f3 ff ff       	call   8001a7 <_panic>

00800dc2 <sys_env_set_trapframe>:

int
sys_env_set_trapframe(envid_t envid, struct Trapframe *tf)
{
  800dc2:	f3 0f 1e fb          	endbr32 
  800dc6:	55                   	push   %ebp
  800dc7:	89 e5                	mov    %esp,%ebp
  800dc9:	57                   	push   %edi
  800dca:	56                   	push   %esi
  800dcb:	53                   	push   %ebx
  800dcc:	83 ec 0c             	sub    $0xc,%esp
	asm volatile("int %1\n"
  800dcf:	bb 00 00 00 00       	mov    $0x0,%ebx
  800dd4:	8b 55 08             	mov    0x8(%ebp),%edx
  800dd7:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  800dda:	b8 09 00 00 00       	mov    $0x9,%eax
  800ddf:	89 df                	mov    %ebx,%edi
  800de1:	89 de                	mov    %ebx,%esi
  800de3:	cd 30                	int    $0x30
	if(check && ret > 0)
  800de5:	85 c0                	test   %eax,%eax
  800de7:	7f 08                	jg     800df1 <sys_env_set_trapframe+0x2f>
	return syscall(SYS_env_set_trapframe, 1, envid, (uint32_t) tf, 0, 0, 0);
}
  800de9:	8d 65 f4             	lea    -0xc(%ebp),%esp
  800dec:	5b                   	pop    %ebx
  800ded:	5e                   	pop    %esi
  800dee:	5f                   	pop    %edi
  800def:	5d                   	pop    %ebp
  800df0:	c3                   	ret    
		panic("syscall %d returned %d (> 0)", num, ret);
  800df1:	83 ec 0c             	sub    $0xc,%esp
  800df4:	50                   	push   %eax
  800df5:	6a 09                	push   $0x9
  800df7:	68 5f 24 80 00       	push   $0x80245f
  800dfc:	6a 23                	push   $0x23
  800dfe:	68 7c 24 80 00       	push   $0x80247c
  800e03:	e8 9f f3 ff ff       	call   8001a7 <_panic>

00800e08 <sys_env_set_pgfault_upcall>:

int
sys_env_set_pgfault_upcall(envid_t envid, void *upcall)
{
  800e08:	f3 0f 1e fb          	endbr32 
  800e0c:	55                   	push   %ebp
  800e0d:	89 e5                	mov    %esp,%ebp
  800e0f:	57                   	push   %edi
  800e10:	56                   	push   %esi
  800e11:	53                   	push   %ebx
  800e12:	83 ec 0c             	sub    $0xc,%esp
	asm volatile("int %1\n"
  800e15:	bb 00 00 00 00       	mov    $0x0,%ebx
  800e1a:	8b 55 08             	mov    0x8(%ebp),%edx
  800e1d:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  800e20:	b8 0a 00 00 00       	mov    $0xa,%eax
  800e25:	89 df                	mov    %ebx,%edi
  800e27:	89 de                	mov    %ebx,%esi
  800e29:	cd 30                	int    $0x30
	if(check && ret > 0)
  800e2b:	85 c0                	test   %eax,%eax
  800e2d:	7f 08                	jg     800e37 <sys_env_set_pgfault_upcall+0x2f>
	return syscall(SYS_env_set_pgfault_upcall, 1, envid, (uint32_t) upcall, 0, 0, 0);
}
  800e2f:	8d 65 f4             	lea    -0xc(%ebp),%esp
  800e32:	5b                   	pop    %ebx
  800e33:	5e                   	pop    %esi
  800e34:	5f                   	pop    %edi
  800e35:	5d                   	pop    %ebp
  800e36:	c3                   	ret    
		panic("syscall %d returned %d (> 0)", num, ret);
  800e37:	83 ec 0c             	sub    $0xc,%esp
  800e3a:	50                   	push   %eax
  800e3b:	6a 0a                	push   $0xa
  800e3d:	68 5f 24 80 00       	push   $0x80245f
  800e42:	6a 23                	push   $0x23
  800e44:	68 7c 24 80 00       	push   $0x80247c
  800e49:	e8 59 f3 ff ff       	call   8001a7 <_panic>

00800e4e <sys_ipc_try_send>:

int
sys_ipc_try_send(envid_t envid, uint32_t value, void *srcva, int perm)
{
  800e4e:	f3 0f 1e fb          	endbr32 
  800e52:	55                   	push   %ebp
  800e53:	89 e5                	mov    %esp,%ebp
  800e55:	57                   	push   %edi
  800e56:	56                   	push   %esi
  800e57:	53                   	push   %ebx
	asm volatile("int %1\n"
  800e58:	8b 55 08             	mov    0x8(%ebp),%edx
  800e5b:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  800e5e:	b8 0c 00 00 00       	mov    $0xc,%eax
  800e63:	be 00 00 00 00       	mov    $0x0,%esi
  800e68:	8b 5d 10             	mov    0x10(%ebp),%ebx
  800e6b:	8b 7d 14             	mov    0x14(%ebp),%edi
  800e6e:	cd 30                	int    $0x30
	return syscall(SYS_ipc_try_send, 0, envid, value, (uint32_t) srcva, perm, 0);
}
  800e70:	5b                   	pop    %ebx
  800e71:	5e                   	pop    %esi
  800e72:	5f                   	pop    %edi
  800e73:	5d                   	pop    %ebp
  800e74:	c3                   	ret    

00800e75 <sys_ipc_recv>:

int
sys_ipc_recv(void *dstva)
{
  800e75:	f3 0f 1e fb          	endbr32 
  800e79:	55                   	push   %ebp
  800e7a:	89 e5                	mov    %esp,%ebp
  800e7c:	57                   	push   %edi
  800e7d:	56                   	push   %esi
  800e7e:	53                   	push   %ebx
  800e7f:	83 ec 0c             	sub    $0xc,%esp
	asm volatile("int %1\n"
  800e82:	b9 00 00 00 00       	mov    $0x0,%ecx
  800e87:	8b 55 08             	mov    0x8(%ebp),%edx
  800e8a:	b8 0d 00 00 00       	mov    $0xd,%eax
  800e8f:	89 cb                	mov    %ecx,%ebx
  800e91:	89 cf                	mov    %ecx,%edi
  800e93:	89 ce                	mov    %ecx,%esi
  800e95:	cd 30                	int    $0x30
	if(check && ret > 0)
  800e97:	85 c0                	test   %eax,%eax
  800e99:	7f 08                	jg     800ea3 <sys_ipc_recv+0x2e>
	return syscall(SYS_ipc_recv, 1, (uint32_t)dstva, 0, 0, 0, 0);
}
  800e9b:	8d 65 f4             	lea    -0xc(%ebp),%esp
  800e9e:	5b                   	pop    %ebx
  800e9f:	5e                   	pop    %esi
  800ea0:	5f                   	pop    %edi
  800ea1:	5d                   	pop    %ebp
  800ea2:	c3                   	ret    
		panic("syscall %d returned %d (> 0)", num, ret);
  800ea3:	83 ec 0c             	sub    $0xc,%esp
  800ea6:	50                   	push   %eax
  800ea7:	6a 0d                	push   $0xd
  800ea9:	68 5f 24 80 00       	push   $0x80245f
  800eae:	6a 23                	push   $0x23
  800eb0:	68 7c 24 80 00       	push   $0x80247c
  800eb5:	e8 ed f2 ff ff       	call   8001a7 <_panic>

00800eba <fd2num>:
// File descriptor manipulators
// --------------------------------------------------------------

int
fd2num(struct Fd *fd)
{
  800eba:	f3 0f 1e fb          	endbr32 
  800ebe:	55                   	push   %ebp
  800ebf:	89 e5                	mov    %esp,%ebp
	return ((uintptr_t) fd - FDTABLE) / PGSIZE;
  800ec1:	8b 45 08             	mov    0x8(%ebp),%eax
  800ec4:	05 00 00 00 30       	add    $0x30000000,%eax
  800ec9:	c1 e8 0c             	shr    $0xc,%eax
}
  800ecc:	5d                   	pop    %ebp
  800ecd:	c3                   	ret    

00800ece <fd2data>:

char*
fd2data(struct Fd *fd)
{
  800ece:	f3 0f 1e fb          	endbr32 
  800ed2:	55                   	push   %ebp
  800ed3:	89 e5                	mov    %esp,%ebp
	return ((uintptr_t) fd - FDTABLE) / PGSIZE;
  800ed5:	8b 45 08             	mov    0x8(%ebp),%eax
  800ed8:	05 00 00 00 30       	add    $0x30000000,%eax
	return INDEX2DATA(fd2num(fd));
  800edd:	25 00 f0 ff ff       	and    $0xfffff000,%eax
  800ee2:	2d 00 00 fe 2f       	sub    $0x2ffe0000,%eax
}
  800ee7:	5d                   	pop    %ebp
  800ee8:	c3                   	ret    

00800ee9 <fd_alloc>:
// Returns 0 on success, < 0 on error.  Errors are:
//	-E_MAX_FD: no more file descriptors
// On error, *fd_store is set to 0.
int
fd_alloc(struct Fd **fd_store)
{
  800ee9:	f3 0f 1e fb          	endbr32 
  800eed:	55                   	push   %ebp
  800eee:	89 e5                	mov    %esp,%ebp
  800ef0:	b8 00 00 00 d0       	mov    $0xd0000000,%eax
	int i;
	struct Fd *fd;

	for (i = 0; i < MAXFD; i++) {
		fd = INDEX2FD(i);
		if ((uvpd[PDX(fd)] & PTE_P) == 0 || (uvpt[PGNUM(fd)] & PTE_P) == 0) {
  800ef5:	89 c2                	mov    %eax,%edx
  800ef7:	c1 ea 16             	shr    $0x16,%edx
  800efa:	8b 14 95 00 d0 7b ef 	mov    -0x10843000(,%edx,4),%edx
  800f01:	f6 c2 01             	test   $0x1,%dl
  800f04:	74 2d                	je     800f33 <fd_alloc+0x4a>
  800f06:	89 c2                	mov    %eax,%edx
  800f08:	c1 ea 0c             	shr    $0xc,%edx
  800f0b:	8b 14 95 00 00 40 ef 	mov    -0x10c00000(,%edx,4),%edx
  800f12:	f6 c2 01             	test   $0x1,%dl
  800f15:	74 1c                	je     800f33 <fd_alloc+0x4a>
  800f17:	05 00 10 00 00       	add    $0x1000,%eax
	for (i = 0; i < MAXFD; i++) {
  800f1c:	3d 00 00 02 d0       	cmp    $0xd0020000,%eax
  800f21:	75 d2                	jne    800ef5 <fd_alloc+0xc>
			*fd_store = fd;
			return 0;
		}
	}
	*fd_store = 0;
  800f23:	8b 45 08             	mov    0x8(%ebp),%eax
  800f26:	c7 00 00 00 00 00    	movl   $0x0,(%eax)
	return -E_MAX_OPEN;
  800f2c:	b8 f6 ff ff ff       	mov    $0xfffffff6,%eax
  800f31:	eb 0a                	jmp    800f3d <fd_alloc+0x54>
			*fd_store = fd;
  800f33:	8b 4d 08             	mov    0x8(%ebp),%ecx
  800f36:	89 01                	mov    %eax,(%ecx)
			return 0;
  800f38:	b8 00 00 00 00       	mov    $0x0,%eax
}
  800f3d:	5d                   	pop    %ebp
  800f3e:	c3                   	ret    

00800f3f <fd_lookup>:
// Returns 0 on success (the page is in range and mapped), < 0 on error.
// Errors are:
//	-E_INVAL: fdnum was either not in range or not mapped.
int
fd_lookup(int fdnum, struct Fd **fd_store)
{
  800f3f:	f3 0f 1e fb          	endbr32 
  800f43:	55                   	push   %ebp
  800f44:	89 e5                	mov    %esp,%ebp
  800f46:	8b 45 08             	mov    0x8(%ebp),%eax
	struct Fd *fd;

	if (fdnum < 0 || fdnum >= MAXFD) {
  800f49:	83 f8 1f             	cmp    $0x1f,%eax
  800f4c:	77 30                	ja     800f7e <fd_lookup+0x3f>
		if (debug)
			cprintf("[%08x] bad fd %d\n", thisenv->env_id, fdnum);
		return -E_INVAL;
	}
	fd = INDEX2FD(fdnum);
  800f4e:	c1 e0 0c             	shl    $0xc,%eax
  800f51:	2d 00 00 00 30       	sub    $0x30000000,%eax
	if (!(uvpd[PDX(fd)] & PTE_P) || !(uvpt[PGNUM(fd)] & PTE_P)) {
  800f56:	8b 15 00 dd 7b ef    	mov    0xef7bdd00,%edx
  800f5c:	f6 c2 01             	test   $0x1,%dl
  800f5f:	74 24                	je     800f85 <fd_lookup+0x46>
  800f61:	89 c2                	mov    %eax,%edx
  800f63:	c1 ea 0c             	shr    $0xc,%edx
  800f66:	8b 14 95 00 00 40 ef 	mov    -0x10c00000(,%edx,4),%edx
  800f6d:	f6 c2 01             	test   $0x1,%dl
  800f70:	74 1a                	je     800f8c <fd_lookup+0x4d>
		if (debug)
			cprintf("[%08x] closed fd %d\n", thisenv->env_id, fdnum);
		return -E_INVAL;
	}
	*fd_store = fd;
  800f72:	8b 55 0c             	mov    0xc(%ebp),%edx
  800f75:	89 02                	mov    %eax,(%edx)
	return 0;
  800f77:	b8 00 00 00 00       	mov    $0x0,%eax
}
  800f7c:	5d                   	pop    %ebp
  800f7d:	c3                   	ret    
		return -E_INVAL;
  800f7e:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
  800f83:	eb f7                	jmp    800f7c <fd_lookup+0x3d>
		return -E_INVAL;
  800f85:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
  800f8a:	eb f0                	jmp    800f7c <fd_lookup+0x3d>
  800f8c:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
  800f91:	eb e9                	jmp    800f7c <fd_lookup+0x3d>

00800f93 <dev_lookup>:
	0
};

int
dev_lookup(int dev_id, struct Dev **dev)
{
  800f93:	f3 0f 1e fb          	endbr32 
  800f97:	55                   	push   %ebp
  800f98:	89 e5                	mov    %esp,%ebp
  800f9a:	83 ec 08             	sub    $0x8,%esp
  800f9d:	8b 4d 08             	mov    0x8(%ebp),%ecx
  800fa0:	ba 08 25 80 00       	mov    $0x802508,%edx
	int i;
	for (i = 0; devtab[i]; i++)
  800fa5:	b8 04 30 80 00       	mov    $0x803004,%eax
		if (devtab[i]->dev_id == dev_id) {
  800faa:	39 08                	cmp    %ecx,(%eax)
  800fac:	74 33                	je     800fe1 <dev_lookup+0x4e>
  800fae:	83 c2 04             	add    $0x4,%edx
	for (i = 0; devtab[i]; i++)
  800fb1:	8b 02                	mov    (%edx),%eax
  800fb3:	85 c0                	test   %eax,%eax
  800fb5:	75 f3                	jne    800faa <dev_lookup+0x17>
			*dev = devtab[i];
			return 0;
		}
	cprintf("[%08x] unknown device type %d\n", thisenv->env_id, dev_id);
  800fb7:	a1 20 60 80 00       	mov    0x806020,%eax
  800fbc:	8b 40 48             	mov    0x48(%eax),%eax
  800fbf:	83 ec 04             	sub    $0x4,%esp
  800fc2:	51                   	push   %ecx
  800fc3:	50                   	push   %eax
  800fc4:	68 8c 24 80 00       	push   $0x80248c
  800fc9:	e8 c0 f2 ff ff       	call   80028e <cprintf>
	*dev = 0;
  800fce:	8b 45 0c             	mov    0xc(%ebp),%eax
  800fd1:	c7 00 00 00 00 00    	movl   $0x0,(%eax)
	return -E_INVAL;
  800fd7:	83 c4 10             	add    $0x10,%esp
  800fda:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
}
  800fdf:	c9                   	leave  
  800fe0:	c3                   	ret    
			*dev = devtab[i];
  800fe1:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  800fe4:	89 01                	mov    %eax,(%ecx)
			return 0;
  800fe6:	b8 00 00 00 00       	mov    $0x0,%eax
  800feb:	eb f2                	jmp    800fdf <dev_lookup+0x4c>

00800fed <fd_close>:
{
  800fed:	f3 0f 1e fb          	endbr32 
  800ff1:	55                   	push   %ebp
  800ff2:	89 e5                	mov    %esp,%ebp
  800ff4:	57                   	push   %edi
  800ff5:	56                   	push   %esi
  800ff6:	53                   	push   %ebx
  800ff7:	83 ec 24             	sub    $0x24,%esp
  800ffa:	8b 75 08             	mov    0x8(%ebp),%esi
  800ffd:	8b 7d 0c             	mov    0xc(%ebp),%edi
	if ((r = fd_lookup(fd2num(fd), &fd2)) < 0
  801000:	8d 45 e4             	lea    -0x1c(%ebp),%eax
  801003:	50                   	push   %eax
	return ((uintptr_t) fd - FDTABLE) / PGSIZE;
  801004:	8d 86 00 00 00 30    	lea    0x30000000(%esi),%eax
  80100a:	c1 e8 0c             	shr    $0xc,%eax
	if ((r = fd_lookup(fd2num(fd), &fd2)) < 0
  80100d:	50                   	push   %eax
  80100e:	e8 2c ff ff ff       	call   800f3f <fd_lookup>
  801013:	89 c3                	mov    %eax,%ebx
  801015:	83 c4 10             	add    $0x10,%esp
  801018:	85 c0                	test   %eax,%eax
  80101a:	78 05                	js     801021 <fd_close+0x34>
	    || fd != fd2)
  80101c:	39 75 e4             	cmp    %esi,-0x1c(%ebp)
  80101f:	74 16                	je     801037 <fd_close+0x4a>
		return (must_exist ? r : 0);
  801021:	89 f8                	mov    %edi,%eax
  801023:	84 c0                	test   %al,%al
  801025:	b8 00 00 00 00       	mov    $0x0,%eax
  80102a:	0f 44 d8             	cmove  %eax,%ebx
}
  80102d:	89 d8                	mov    %ebx,%eax
  80102f:	8d 65 f4             	lea    -0xc(%ebp),%esp
  801032:	5b                   	pop    %ebx
  801033:	5e                   	pop    %esi
  801034:	5f                   	pop    %edi
  801035:	5d                   	pop    %ebp
  801036:	c3                   	ret    
	if ((r = dev_lookup(fd->fd_dev_id, &dev)) >= 0) {
  801037:	83 ec 08             	sub    $0x8,%esp
  80103a:	8d 45 e0             	lea    -0x20(%ebp),%eax
  80103d:	50                   	push   %eax
  80103e:	ff 36                	pushl  (%esi)
  801040:	e8 4e ff ff ff       	call   800f93 <dev_lookup>
  801045:	89 c3                	mov    %eax,%ebx
  801047:	83 c4 10             	add    $0x10,%esp
  80104a:	85 c0                	test   %eax,%eax
  80104c:	78 1a                	js     801068 <fd_close+0x7b>
		if (dev->dev_close)
  80104e:	8b 45 e0             	mov    -0x20(%ebp),%eax
  801051:	8b 40 10             	mov    0x10(%eax),%eax
			r = 0;
  801054:	bb 00 00 00 00       	mov    $0x0,%ebx
		if (dev->dev_close)
  801059:	85 c0                	test   %eax,%eax
  80105b:	74 0b                	je     801068 <fd_close+0x7b>
			r = (*dev->dev_close)(fd);
  80105d:	83 ec 0c             	sub    $0xc,%esp
  801060:	56                   	push   %esi
  801061:	ff d0                	call   *%eax
  801063:	89 c3                	mov    %eax,%ebx
  801065:	83 c4 10             	add    $0x10,%esp
	(void) sys_page_unmap(0, fd);
  801068:	83 ec 08             	sub    $0x8,%esp
  80106b:	56                   	push   %esi
  80106c:	6a 00                	push   $0x0
  80106e:	e8 c3 fc ff ff       	call   800d36 <sys_page_unmap>
	return r;
  801073:	83 c4 10             	add    $0x10,%esp
  801076:	eb b5                	jmp    80102d <fd_close+0x40>

00801078 <close>:

int
close(int fdnum)
{
  801078:	f3 0f 1e fb          	endbr32 
  80107c:	55                   	push   %ebp
  80107d:	89 e5                	mov    %esp,%ebp
  80107f:	83 ec 20             	sub    $0x20,%esp
	struct Fd *fd;
	int r;

	if ((r = fd_lookup(fdnum, &fd)) < 0)
  801082:	8d 45 f4             	lea    -0xc(%ebp),%eax
  801085:	50                   	push   %eax
  801086:	ff 75 08             	pushl  0x8(%ebp)
  801089:	e8 b1 fe ff ff       	call   800f3f <fd_lookup>
  80108e:	83 c4 10             	add    $0x10,%esp
  801091:	85 c0                	test   %eax,%eax
  801093:	79 02                	jns    801097 <close+0x1f>
		return r;
	else
		return fd_close(fd, 1);
}
  801095:	c9                   	leave  
  801096:	c3                   	ret    
		return fd_close(fd, 1);
  801097:	83 ec 08             	sub    $0x8,%esp
  80109a:	6a 01                	push   $0x1
  80109c:	ff 75 f4             	pushl  -0xc(%ebp)
  80109f:	e8 49 ff ff ff       	call   800fed <fd_close>
  8010a4:	83 c4 10             	add    $0x10,%esp
  8010a7:	eb ec                	jmp    801095 <close+0x1d>

008010a9 <close_all>:

void
close_all(void)
{
  8010a9:	f3 0f 1e fb          	endbr32 
  8010ad:	55                   	push   %ebp
  8010ae:	89 e5                	mov    %esp,%ebp
  8010b0:	53                   	push   %ebx
  8010b1:	83 ec 04             	sub    $0x4,%esp
	int i;
	for (i = 0; i < MAXFD; i++)
  8010b4:	bb 00 00 00 00       	mov    $0x0,%ebx
		close(i);
  8010b9:	83 ec 0c             	sub    $0xc,%esp
  8010bc:	53                   	push   %ebx
  8010bd:	e8 b6 ff ff ff       	call   801078 <close>
	for (i = 0; i < MAXFD; i++)
  8010c2:	83 c3 01             	add    $0x1,%ebx
  8010c5:	83 c4 10             	add    $0x10,%esp
  8010c8:	83 fb 20             	cmp    $0x20,%ebx
  8010cb:	75 ec                	jne    8010b9 <close_all+0x10>
}
  8010cd:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  8010d0:	c9                   	leave  
  8010d1:	c3                   	ret    

008010d2 <dup>:
// file and the file offset of the other.
// Closes any previously open file descriptor at 'newfdnum'.
// This is implemented using virtual memory tricks (of course!).
int
dup(int oldfdnum, int newfdnum)
{
  8010d2:	f3 0f 1e fb          	endbr32 
  8010d6:	55                   	push   %ebp
  8010d7:	89 e5                	mov    %esp,%ebp
  8010d9:	57                   	push   %edi
  8010da:	56                   	push   %esi
  8010db:	53                   	push   %ebx
  8010dc:	83 ec 24             	sub    $0x24,%esp
	int r;
	char *ova, *nva;
	pte_t pte;
	struct Fd *oldfd, *newfd;

	if ((r = fd_lookup(oldfdnum, &oldfd)) < 0)
  8010df:	8d 45 e4             	lea    -0x1c(%ebp),%eax
  8010e2:	50                   	push   %eax
  8010e3:	ff 75 08             	pushl  0x8(%ebp)
  8010e6:	e8 54 fe ff ff       	call   800f3f <fd_lookup>
  8010eb:	89 c3                	mov    %eax,%ebx
  8010ed:	83 c4 10             	add    $0x10,%esp
  8010f0:	85 c0                	test   %eax,%eax
  8010f2:	0f 88 81 00 00 00    	js     801179 <dup+0xa7>
		return r;
	close(newfdnum);
  8010f8:	83 ec 0c             	sub    $0xc,%esp
  8010fb:	ff 75 0c             	pushl  0xc(%ebp)
  8010fe:	e8 75 ff ff ff       	call   801078 <close>

	newfd = INDEX2FD(newfdnum);
  801103:	8b 75 0c             	mov    0xc(%ebp),%esi
  801106:	c1 e6 0c             	shl    $0xc,%esi
  801109:	81 ee 00 00 00 30    	sub    $0x30000000,%esi
	ova = fd2data(oldfd);
  80110f:	83 c4 04             	add    $0x4,%esp
  801112:	ff 75 e4             	pushl  -0x1c(%ebp)
  801115:	e8 b4 fd ff ff       	call   800ece <fd2data>
  80111a:	89 c3                	mov    %eax,%ebx
	nva = fd2data(newfd);
  80111c:	89 34 24             	mov    %esi,(%esp)
  80111f:	e8 aa fd ff ff       	call   800ece <fd2data>
  801124:	83 c4 10             	add    $0x10,%esp
  801127:	89 c7                	mov    %eax,%edi

	if ((uvpd[PDX(ova)] & PTE_P) && (uvpt[PGNUM(ova)] & PTE_P))
  801129:	89 d8                	mov    %ebx,%eax
  80112b:	c1 e8 16             	shr    $0x16,%eax
  80112e:	8b 04 85 00 d0 7b ef 	mov    -0x10843000(,%eax,4),%eax
  801135:	a8 01                	test   $0x1,%al
  801137:	74 11                	je     80114a <dup+0x78>
  801139:	89 d8                	mov    %ebx,%eax
  80113b:	c1 e8 0c             	shr    $0xc,%eax
  80113e:	8b 14 85 00 00 40 ef 	mov    -0x10c00000(,%eax,4),%edx
  801145:	f6 c2 01             	test   $0x1,%dl
  801148:	75 39                	jne    801183 <dup+0xb1>
		if ((r = sys_page_map(0, ova, 0, nva, uvpt[PGNUM(ova)] & PTE_SYSCALL)) < 0)
			goto err;
	if ((r = sys_page_map(0, oldfd, 0, newfd, uvpt[PGNUM(oldfd)] & PTE_SYSCALL)) < 0)
  80114a:	8b 55 e4             	mov    -0x1c(%ebp),%edx
  80114d:	89 d0                	mov    %edx,%eax
  80114f:	c1 e8 0c             	shr    $0xc,%eax
  801152:	8b 04 85 00 00 40 ef 	mov    -0x10c00000(,%eax,4),%eax
  801159:	83 ec 0c             	sub    $0xc,%esp
  80115c:	25 07 0e 00 00       	and    $0xe07,%eax
  801161:	50                   	push   %eax
  801162:	56                   	push   %esi
  801163:	6a 00                	push   $0x0
  801165:	52                   	push   %edx
  801166:	6a 00                	push   $0x0
  801168:	e8 83 fb ff ff       	call   800cf0 <sys_page_map>
  80116d:	89 c3                	mov    %eax,%ebx
  80116f:	83 c4 20             	add    $0x20,%esp
  801172:	85 c0                	test   %eax,%eax
  801174:	78 31                	js     8011a7 <dup+0xd5>
		goto err;

	return newfdnum;
  801176:	8b 5d 0c             	mov    0xc(%ebp),%ebx

err:
	sys_page_unmap(0, newfd);
	sys_page_unmap(0, nva);
	return r;
}
  801179:	89 d8                	mov    %ebx,%eax
  80117b:	8d 65 f4             	lea    -0xc(%ebp),%esp
  80117e:	5b                   	pop    %ebx
  80117f:	5e                   	pop    %esi
  801180:	5f                   	pop    %edi
  801181:	5d                   	pop    %ebp
  801182:	c3                   	ret    
		if ((r = sys_page_map(0, ova, 0, nva, uvpt[PGNUM(ova)] & PTE_SYSCALL)) < 0)
  801183:	8b 04 85 00 00 40 ef 	mov    -0x10c00000(,%eax,4),%eax
  80118a:	83 ec 0c             	sub    $0xc,%esp
  80118d:	25 07 0e 00 00       	and    $0xe07,%eax
  801192:	50                   	push   %eax
  801193:	57                   	push   %edi
  801194:	6a 00                	push   $0x0
  801196:	53                   	push   %ebx
  801197:	6a 00                	push   $0x0
  801199:	e8 52 fb ff ff       	call   800cf0 <sys_page_map>
  80119e:	89 c3                	mov    %eax,%ebx
  8011a0:	83 c4 20             	add    $0x20,%esp
  8011a3:	85 c0                	test   %eax,%eax
  8011a5:	79 a3                	jns    80114a <dup+0x78>
	sys_page_unmap(0, newfd);
  8011a7:	83 ec 08             	sub    $0x8,%esp
  8011aa:	56                   	push   %esi
  8011ab:	6a 00                	push   $0x0
  8011ad:	e8 84 fb ff ff       	call   800d36 <sys_page_unmap>
	sys_page_unmap(0, nva);
  8011b2:	83 c4 08             	add    $0x8,%esp
  8011b5:	57                   	push   %edi
  8011b6:	6a 00                	push   $0x0
  8011b8:	e8 79 fb ff ff       	call   800d36 <sys_page_unmap>
	return r;
  8011bd:	83 c4 10             	add    $0x10,%esp
  8011c0:	eb b7                	jmp    801179 <dup+0xa7>

008011c2 <read>:

ssize_t
read(int fdnum, void *buf, size_t n)
{
  8011c2:	f3 0f 1e fb          	endbr32 
  8011c6:	55                   	push   %ebp
  8011c7:	89 e5                	mov    %esp,%ebp
  8011c9:	53                   	push   %ebx
  8011ca:	83 ec 1c             	sub    $0x1c,%esp
  8011cd:	8b 5d 08             	mov    0x8(%ebp),%ebx
	int r;
	struct Dev *dev;
	struct Fd *fd;

	if ((r = fd_lookup(fdnum, &fd)) < 0
  8011d0:	8d 45 f0             	lea    -0x10(%ebp),%eax
  8011d3:	50                   	push   %eax
  8011d4:	53                   	push   %ebx
  8011d5:	e8 65 fd ff ff       	call   800f3f <fd_lookup>
  8011da:	83 c4 10             	add    $0x10,%esp
  8011dd:	85 c0                	test   %eax,%eax
  8011df:	78 3f                	js     801220 <read+0x5e>
	    || (r = dev_lookup(fd->fd_dev_id, &dev)) < 0)
  8011e1:	83 ec 08             	sub    $0x8,%esp
  8011e4:	8d 45 f4             	lea    -0xc(%ebp),%eax
  8011e7:	50                   	push   %eax
  8011e8:	8b 45 f0             	mov    -0x10(%ebp),%eax
  8011eb:	ff 30                	pushl  (%eax)
  8011ed:	e8 a1 fd ff ff       	call   800f93 <dev_lookup>
  8011f2:	83 c4 10             	add    $0x10,%esp
  8011f5:	85 c0                	test   %eax,%eax
  8011f7:	78 27                	js     801220 <read+0x5e>
		return r;
	if ((fd->fd_omode & O_ACCMODE) == O_WRONLY) {
  8011f9:	8b 55 f0             	mov    -0x10(%ebp),%edx
  8011fc:	8b 42 08             	mov    0x8(%edx),%eax
  8011ff:	83 e0 03             	and    $0x3,%eax
  801202:	83 f8 01             	cmp    $0x1,%eax
  801205:	74 1e                	je     801225 <read+0x63>
		cprintf("[%08x] read %d -- bad mode\n", thisenv->env_id, fdnum);
		return -E_INVAL;
	}
	if (!dev->dev_read)
  801207:	8b 45 f4             	mov    -0xc(%ebp),%eax
  80120a:	8b 40 08             	mov    0x8(%eax),%eax
  80120d:	85 c0                	test   %eax,%eax
  80120f:	74 35                	je     801246 <read+0x84>
		return -E_NOT_SUPP;
	return (*dev->dev_read)(fd, buf, n);
  801211:	83 ec 04             	sub    $0x4,%esp
  801214:	ff 75 10             	pushl  0x10(%ebp)
  801217:	ff 75 0c             	pushl  0xc(%ebp)
  80121a:	52                   	push   %edx
  80121b:	ff d0                	call   *%eax
  80121d:	83 c4 10             	add    $0x10,%esp
}
  801220:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  801223:	c9                   	leave  
  801224:	c3                   	ret    
		cprintf("[%08x] read %d -- bad mode\n", thisenv->env_id, fdnum);
  801225:	a1 20 60 80 00       	mov    0x806020,%eax
  80122a:	8b 40 48             	mov    0x48(%eax),%eax
  80122d:	83 ec 04             	sub    $0x4,%esp
  801230:	53                   	push   %ebx
  801231:	50                   	push   %eax
  801232:	68 cd 24 80 00       	push   $0x8024cd
  801237:	e8 52 f0 ff ff       	call   80028e <cprintf>
		return -E_INVAL;
  80123c:	83 c4 10             	add    $0x10,%esp
  80123f:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
  801244:	eb da                	jmp    801220 <read+0x5e>
		return -E_NOT_SUPP;
  801246:	b8 f1 ff ff ff       	mov    $0xfffffff1,%eax
  80124b:	eb d3                	jmp    801220 <read+0x5e>

0080124d <readn>:

ssize_t
readn(int fdnum, void *buf, size_t n)
{
  80124d:	f3 0f 1e fb          	endbr32 
  801251:	55                   	push   %ebp
  801252:	89 e5                	mov    %esp,%ebp
  801254:	57                   	push   %edi
  801255:	56                   	push   %esi
  801256:	53                   	push   %ebx
  801257:	83 ec 0c             	sub    $0xc,%esp
  80125a:	8b 7d 08             	mov    0x8(%ebp),%edi
  80125d:	8b 75 10             	mov    0x10(%ebp),%esi
	int m, tot;

	for (tot = 0; tot < n; tot += m) {
  801260:	bb 00 00 00 00       	mov    $0x0,%ebx
  801265:	eb 02                	jmp    801269 <readn+0x1c>
  801267:	01 c3                	add    %eax,%ebx
  801269:	39 f3                	cmp    %esi,%ebx
  80126b:	73 21                	jae    80128e <readn+0x41>
		m = read(fdnum, (char*)buf + tot, n - tot);
  80126d:	83 ec 04             	sub    $0x4,%esp
  801270:	89 f0                	mov    %esi,%eax
  801272:	29 d8                	sub    %ebx,%eax
  801274:	50                   	push   %eax
  801275:	89 d8                	mov    %ebx,%eax
  801277:	03 45 0c             	add    0xc(%ebp),%eax
  80127a:	50                   	push   %eax
  80127b:	57                   	push   %edi
  80127c:	e8 41 ff ff ff       	call   8011c2 <read>
		if (m < 0)
  801281:	83 c4 10             	add    $0x10,%esp
  801284:	85 c0                	test   %eax,%eax
  801286:	78 04                	js     80128c <readn+0x3f>
			return m;
		if (m == 0)
  801288:	75 dd                	jne    801267 <readn+0x1a>
  80128a:	eb 02                	jmp    80128e <readn+0x41>
		m = read(fdnum, (char*)buf + tot, n - tot);
  80128c:	89 c3                	mov    %eax,%ebx
			break;
	}
	return tot;
}
  80128e:	89 d8                	mov    %ebx,%eax
  801290:	8d 65 f4             	lea    -0xc(%ebp),%esp
  801293:	5b                   	pop    %ebx
  801294:	5e                   	pop    %esi
  801295:	5f                   	pop    %edi
  801296:	5d                   	pop    %ebp
  801297:	c3                   	ret    

00801298 <write>:

ssize_t
write(int fdnum, const void *buf, size_t n)
{
  801298:	f3 0f 1e fb          	endbr32 
  80129c:	55                   	push   %ebp
  80129d:	89 e5                	mov    %esp,%ebp
  80129f:	53                   	push   %ebx
  8012a0:	83 ec 1c             	sub    $0x1c,%esp
  8012a3:	8b 5d 08             	mov    0x8(%ebp),%ebx
	int r;
	struct Dev *dev;
	struct Fd *fd;

	if ((r = fd_lookup(fdnum, &fd)) < 0
  8012a6:	8d 45 f0             	lea    -0x10(%ebp),%eax
  8012a9:	50                   	push   %eax
  8012aa:	53                   	push   %ebx
  8012ab:	e8 8f fc ff ff       	call   800f3f <fd_lookup>
  8012b0:	83 c4 10             	add    $0x10,%esp
  8012b3:	85 c0                	test   %eax,%eax
  8012b5:	78 3a                	js     8012f1 <write+0x59>
	    || (r = dev_lookup(fd->fd_dev_id, &dev)) < 0)
  8012b7:	83 ec 08             	sub    $0x8,%esp
  8012ba:	8d 45 f4             	lea    -0xc(%ebp),%eax
  8012bd:	50                   	push   %eax
  8012be:	8b 45 f0             	mov    -0x10(%ebp),%eax
  8012c1:	ff 30                	pushl  (%eax)
  8012c3:	e8 cb fc ff ff       	call   800f93 <dev_lookup>
  8012c8:	83 c4 10             	add    $0x10,%esp
  8012cb:	85 c0                	test   %eax,%eax
  8012cd:	78 22                	js     8012f1 <write+0x59>
		return r;
	if ((fd->fd_omode & O_ACCMODE) == O_RDONLY) {
  8012cf:	8b 45 f0             	mov    -0x10(%ebp),%eax
  8012d2:	f6 40 08 03          	testb  $0x3,0x8(%eax)
  8012d6:	74 1e                	je     8012f6 <write+0x5e>
		return -E_INVAL;
	}
	if (debug)
		cprintf("write %d %p %d via dev %s\n",
			fdnum, buf, n, dev->dev_name);
	if (!dev->dev_write)
  8012d8:	8b 55 f4             	mov    -0xc(%ebp),%edx
  8012db:	8b 52 0c             	mov    0xc(%edx),%edx
  8012de:	85 d2                	test   %edx,%edx
  8012e0:	74 35                	je     801317 <write+0x7f>
		return -E_NOT_SUPP;
	return (*dev->dev_write)(fd, buf, n);
  8012e2:	83 ec 04             	sub    $0x4,%esp
  8012e5:	ff 75 10             	pushl  0x10(%ebp)
  8012e8:	ff 75 0c             	pushl  0xc(%ebp)
  8012eb:	50                   	push   %eax
  8012ec:	ff d2                	call   *%edx
  8012ee:	83 c4 10             	add    $0x10,%esp
}
  8012f1:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  8012f4:	c9                   	leave  
  8012f5:	c3                   	ret    
		cprintf("[%08x] write %d -- bad mode\n", thisenv->env_id, fdnum);
  8012f6:	a1 20 60 80 00       	mov    0x806020,%eax
  8012fb:	8b 40 48             	mov    0x48(%eax),%eax
  8012fe:	83 ec 04             	sub    $0x4,%esp
  801301:	53                   	push   %ebx
  801302:	50                   	push   %eax
  801303:	68 e9 24 80 00       	push   $0x8024e9
  801308:	e8 81 ef ff ff       	call   80028e <cprintf>
		return -E_INVAL;
  80130d:	83 c4 10             	add    $0x10,%esp
  801310:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
  801315:	eb da                	jmp    8012f1 <write+0x59>
		return -E_NOT_SUPP;
  801317:	b8 f1 ff ff ff       	mov    $0xfffffff1,%eax
  80131c:	eb d3                	jmp    8012f1 <write+0x59>

0080131e <seek>:

int
seek(int fdnum, off_t offset)
{
  80131e:	f3 0f 1e fb          	endbr32 
  801322:	55                   	push   %ebp
  801323:	89 e5                	mov    %esp,%ebp
  801325:	83 ec 20             	sub    $0x20,%esp
	int r;
	struct Fd *fd;

	if ((r = fd_lookup(fdnum, &fd)) < 0)
  801328:	8d 45 f4             	lea    -0xc(%ebp),%eax
  80132b:	50                   	push   %eax
  80132c:	ff 75 08             	pushl  0x8(%ebp)
  80132f:	e8 0b fc ff ff       	call   800f3f <fd_lookup>
  801334:	83 c4 10             	add    $0x10,%esp
  801337:	85 c0                	test   %eax,%eax
  801339:	78 0e                	js     801349 <seek+0x2b>
		return r;
	fd->fd_offset = offset;
  80133b:	8b 55 0c             	mov    0xc(%ebp),%edx
  80133e:	8b 45 f4             	mov    -0xc(%ebp),%eax
  801341:	89 50 04             	mov    %edx,0x4(%eax)
	return 0;
  801344:	b8 00 00 00 00       	mov    $0x0,%eax
}
  801349:	c9                   	leave  
  80134a:	c3                   	ret    

0080134b <ftruncate>:

int
ftruncate(int fdnum, off_t newsize)
{
  80134b:	f3 0f 1e fb          	endbr32 
  80134f:	55                   	push   %ebp
  801350:	89 e5                	mov    %esp,%ebp
  801352:	53                   	push   %ebx
  801353:	83 ec 1c             	sub    $0x1c,%esp
  801356:	8b 5d 08             	mov    0x8(%ebp),%ebx
	int r;
	struct Dev *dev;
	struct Fd *fd;
	if ((r = fd_lookup(fdnum, &fd)) < 0
  801359:	8d 45 f0             	lea    -0x10(%ebp),%eax
  80135c:	50                   	push   %eax
  80135d:	53                   	push   %ebx
  80135e:	e8 dc fb ff ff       	call   800f3f <fd_lookup>
  801363:	83 c4 10             	add    $0x10,%esp
  801366:	85 c0                	test   %eax,%eax
  801368:	78 37                	js     8013a1 <ftruncate+0x56>
	    || (r = dev_lookup(fd->fd_dev_id, &dev)) < 0)
  80136a:	83 ec 08             	sub    $0x8,%esp
  80136d:	8d 45 f4             	lea    -0xc(%ebp),%eax
  801370:	50                   	push   %eax
  801371:	8b 45 f0             	mov    -0x10(%ebp),%eax
  801374:	ff 30                	pushl  (%eax)
  801376:	e8 18 fc ff ff       	call   800f93 <dev_lookup>
  80137b:	83 c4 10             	add    $0x10,%esp
  80137e:	85 c0                	test   %eax,%eax
  801380:	78 1f                	js     8013a1 <ftruncate+0x56>
		return r;
	if ((fd->fd_omode & O_ACCMODE) == O_RDONLY) {
  801382:	8b 45 f0             	mov    -0x10(%ebp),%eax
  801385:	f6 40 08 03          	testb  $0x3,0x8(%eax)
  801389:	74 1b                	je     8013a6 <ftruncate+0x5b>
		cprintf("[%08x] ftruncate %d -- bad mode\n",
			thisenv->env_id, fdnum);
		return -E_INVAL;
	}
	if (!dev->dev_trunc)
  80138b:	8b 55 f4             	mov    -0xc(%ebp),%edx
  80138e:	8b 52 18             	mov    0x18(%edx),%edx
  801391:	85 d2                	test   %edx,%edx
  801393:	74 32                	je     8013c7 <ftruncate+0x7c>
		return -E_NOT_SUPP;
	return (*dev->dev_trunc)(fd, newsize);
  801395:	83 ec 08             	sub    $0x8,%esp
  801398:	ff 75 0c             	pushl  0xc(%ebp)
  80139b:	50                   	push   %eax
  80139c:	ff d2                	call   *%edx
  80139e:	83 c4 10             	add    $0x10,%esp
}
  8013a1:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  8013a4:	c9                   	leave  
  8013a5:	c3                   	ret    
			thisenv->env_id, fdnum);
  8013a6:	a1 20 60 80 00       	mov    0x806020,%eax
		cprintf("[%08x] ftruncate %d -- bad mode\n",
  8013ab:	8b 40 48             	mov    0x48(%eax),%eax
  8013ae:	83 ec 04             	sub    $0x4,%esp
  8013b1:	53                   	push   %ebx
  8013b2:	50                   	push   %eax
  8013b3:	68 ac 24 80 00       	push   $0x8024ac
  8013b8:	e8 d1 ee ff ff       	call   80028e <cprintf>
		return -E_INVAL;
  8013bd:	83 c4 10             	add    $0x10,%esp
  8013c0:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
  8013c5:	eb da                	jmp    8013a1 <ftruncate+0x56>
		return -E_NOT_SUPP;
  8013c7:	b8 f1 ff ff ff       	mov    $0xfffffff1,%eax
  8013cc:	eb d3                	jmp    8013a1 <ftruncate+0x56>

008013ce <fstat>:

int
fstat(int fdnum, struct Stat *stat)
{
  8013ce:	f3 0f 1e fb          	endbr32 
  8013d2:	55                   	push   %ebp
  8013d3:	89 e5                	mov    %esp,%ebp
  8013d5:	53                   	push   %ebx
  8013d6:	83 ec 1c             	sub    $0x1c,%esp
  8013d9:	8b 5d 0c             	mov    0xc(%ebp),%ebx
	int r;
	struct Dev *dev;
	struct Fd *fd;

	if ((r = fd_lookup(fdnum, &fd)) < 0
  8013dc:	8d 45 f0             	lea    -0x10(%ebp),%eax
  8013df:	50                   	push   %eax
  8013e0:	ff 75 08             	pushl  0x8(%ebp)
  8013e3:	e8 57 fb ff ff       	call   800f3f <fd_lookup>
  8013e8:	83 c4 10             	add    $0x10,%esp
  8013eb:	85 c0                	test   %eax,%eax
  8013ed:	78 4b                	js     80143a <fstat+0x6c>
	    || (r = dev_lookup(fd->fd_dev_id, &dev)) < 0)
  8013ef:	83 ec 08             	sub    $0x8,%esp
  8013f2:	8d 45 f4             	lea    -0xc(%ebp),%eax
  8013f5:	50                   	push   %eax
  8013f6:	8b 45 f0             	mov    -0x10(%ebp),%eax
  8013f9:	ff 30                	pushl  (%eax)
  8013fb:	e8 93 fb ff ff       	call   800f93 <dev_lookup>
  801400:	83 c4 10             	add    $0x10,%esp
  801403:	85 c0                	test   %eax,%eax
  801405:	78 33                	js     80143a <fstat+0x6c>
		return r;
	if (!dev->dev_stat)
  801407:	8b 45 f4             	mov    -0xc(%ebp),%eax
  80140a:	83 78 14 00          	cmpl   $0x0,0x14(%eax)
  80140e:	74 2f                	je     80143f <fstat+0x71>
		return -E_NOT_SUPP;
	stat->st_name[0] = 0;
  801410:	c6 03 00             	movb   $0x0,(%ebx)
	stat->st_size = 0;
  801413:	c7 83 80 00 00 00 00 	movl   $0x0,0x80(%ebx)
  80141a:	00 00 00 
	stat->st_isdir = 0;
  80141d:	c7 83 84 00 00 00 00 	movl   $0x0,0x84(%ebx)
  801424:	00 00 00 
	stat->st_dev = dev;
  801427:	89 83 88 00 00 00    	mov    %eax,0x88(%ebx)
	return (*dev->dev_stat)(fd, stat);
  80142d:	83 ec 08             	sub    $0x8,%esp
  801430:	53                   	push   %ebx
  801431:	ff 75 f0             	pushl  -0x10(%ebp)
  801434:	ff 50 14             	call   *0x14(%eax)
  801437:	83 c4 10             	add    $0x10,%esp
}
  80143a:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  80143d:	c9                   	leave  
  80143e:	c3                   	ret    
		return -E_NOT_SUPP;
  80143f:	b8 f1 ff ff ff       	mov    $0xfffffff1,%eax
  801444:	eb f4                	jmp    80143a <fstat+0x6c>

00801446 <stat>:

int
stat(const char *path, struct Stat *stat)
{
  801446:	f3 0f 1e fb          	endbr32 
  80144a:	55                   	push   %ebp
  80144b:	89 e5                	mov    %esp,%ebp
  80144d:	56                   	push   %esi
  80144e:	53                   	push   %ebx
	int fd, r;

	if ((fd = open(path, O_RDONLY)) < 0)
  80144f:	83 ec 08             	sub    $0x8,%esp
  801452:	6a 00                	push   $0x0
  801454:	ff 75 08             	pushl  0x8(%ebp)
  801457:	e8 fb 01 00 00       	call   801657 <open>
  80145c:	89 c3                	mov    %eax,%ebx
  80145e:	83 c4 10             	add    $0x10,%esp
  801461:	85 c0                	test   %eax,%eax
  801463:	78 1b                	js     801480 <stat+0x3a>
		return fd;
	r = fstat(fd, stat);
  801465:	83 ec 08             	sub    $0x8,%esp
  801468:	ff 75 0c             	pushl  0xc(%ebp)
  80146b:	50                   	push   %eax
  80146c:	e8 5d ff ff ff       	call   8013ce <fstat>
  801471:	89 c6                	mov    %eax,%esi
	close(fd);
  801473:	89 1c 24             	mov    %ebx,(%esp)
  801476:	e8 fd fb ff ff       	call   801078 <close>
	return r;
  80147b:	83 c4 10             	add    $0x10,%esp
  80147e:	89 f3                	mov    %esi,%ebx
}
  801480:	89 d8                	mov    %ebx,%eax
  801482:	8d 65 f8             	lea    -0x8(%ebp),%esp
  801485:	5b                   	pop    %ebx
  801486:	5e                   	pop    %esi
  801487:	5d                   	pop    %ebp
  801488:	c3                   	ret    

00801489 <fsipc>:
// type: request code, passed as the simple integer IPC value.
// dstva: virtual address at which to receive reply page, 0 if none.
// Returns result from the file server.
static int
fsipc(unsigned type, void *dstva)
{
  801489:	55                   	push   %ebp
  80148a:	89 e5                	mov    %esp,%ebp
  80148c:	56                   	push   %esi
  80148d:	53                   	push   %ebx
  80148e:	89 c6                	mov    %eax,%esi
  801490:	89 d3                	mov    %edx,%ebx
	static envid_t fsenv;
	if (fsenv == 0)
  801492:	83 3d 00 40 80 00 00 	cmpl   $0x0,0x804000
  801499:	74 27                	je     8014c2 <fsipc+0x39>
	static_assert(sizeof(fsipcbuf) == PGSIZE);

	if (debug)
		cprintf("[%08x] fsipc %d %08x\n", thisenv->env_id, type, *(uint32_t *)&fsipcbuf);

	ipc_send(fsenv, type, &fsipcbuf, PTE_P | PTE_W | PTE_U);
  80149b:	6a 07                	push   $0x7
  80149d:	68 00 70 80 00       	push   $0x807000
  8014a2:	56                   	push   %esi
  8014a3:	ff 35 00 40 80 00    	pushl  0x804000
  8014a9:	e8 f6 08 00 00       	call   801da4 <ipc_send>
	return ipc_recv(NULL, dstva, NULL);
  8014ae:	83 c4 0c             	add    $0xc,%esp
  8014b1:	6a 00                	push   $0x0
  8014b3:	53                   	push   %ebx
  8014b4:	6a 00                	push   $0x0
  8014b6:	e8 68 08 00 00       	call   801d23 <ipc_recv>
}
  8014bb:	8d 65 f8             	lea    -0x8(%ebp),%esp
  8014be:	5b                   	pop    %ebx
  8014bf:	5e                   	pop    %esi
  8014c0:	5d                   	pop    %ebp
  8014c1:	c3                   	ret    
		fsenv = ipc_find_env(ENV_TYPE_FS);
  8014c2:	83 ec 0c             	sub    $0xc,%esp
  8014c5:	6a 01                	push   $0x1
  8014c7:	e8 30 09 00 00       	call   801dfc <ipc_find_env>
  8014cc:	a3 00 40 80 00       	mov    %eax,0x804000
  8014d1:	83 c4 10             	add    $0x10,%esp
  8014d4:	eb c5                	jmp    80149b <fsipc+0x12>

008014d6 <devfile_trunc>:
}

// Truncate or extend an open file to 'size' bytes
static int
devfile_trunc(struct Fd *fd, off_t newsize)
{
  8014d6:	f3 0f 1e fb          	endbr32 
  8014da:	55                   	push   %ebp
  8014db:	89 e5                	mov    %esp,%ebp
  8014dd:	83 ec 08             	sub    $0x8,%esp
	fsipcbuf.set_size.req_fileid = fd->fd_file.id;
  8014e0:	8b 45 08             	mov    0x8(%ebp),%eax
  8014e3:	8b 40 0c             	mov    0xc(%eax),%eax
  8014e6:	a3 00 70 80 00       	mov    %eax,0x807000
	fsipcbuf.set_size.req_size = newsize;
  8014eb:	8b 45 0c             	mov    0xc(%ebp),%eax
  8014ee:	a3 04 70 80 00       	mov    %eax,0x807004
	return fsipc(FSREQ_SET_SIZE, NULL);
  8014f3:	ba 00 00 00 00       	mov    $0x0,%edx
  8014f8:	b8 02 00 00 00       	mov    $0x2,%eax
  8014fd:	e8 87 ff ff ff       	call   801489 <fsipc>
}
  801502:	c9                   	leave  
  801503:	c3                   	ret    

00801504 <devfile_flush>:
{
  801504:	f3 0f 1e fb          	endbr32 
  801508:	55                   	push   %ebp
  801509:	89 e5                	mov    %esp,%ebp
  80150b:	83 ec 08             	sub    $0x8,%esp
	fsipcbuf.flush.req_fileid = fd->fd_file.id;
  80150e:	8b 45 08             	mov    0x8(%ebp),%eax
  801511:	8b 40 0c             	mov    0xc(%eax),%eax
  801514:	a3 00 70 80 00       	mov    %eax,0x807000
	return fsipc(FSREQ_FLUSH, NULL);
  801519:	ba 00 00 00 00       	mov    $0x0,%edx
  80151e:	b8 06 00 00 00       	mov    $0x6,%eax
  801523:	e8 61 ff ff ff       	call   801489 <fsipc>
}
  801528:	c9                   	leave  
  801529:	c3                   	ret    

0080152a <devfile_stat>:
{
  80152a:	f3 0f 1e fb          	endbr32 
  80152e:	55                   	push   %ebp
  80152f:	89 e5                	mov    %esp,%ebp
  801531:	53                   	push   %ebx
  801532:	83 ec 04             	sub    $0x4,%esp
  801535:	8b 5d 0c             	mov    0xc(%ebp),%ebx
	fsipcbuf.stat.req_fileid = fd->fd_file.id;
  801538:	8b 45 08             	mov    0x8(%ebp),%eax
  80153b:	8b 40 0c             	mov    0xc(%eax),%eax
  80153e:	a3 00 70 80 00       	mov    %eax,0x807000
	if ((r = fsipc(FSREQ_STAT, NULL)) < 0)
  801543:	ba 00 00 00 00       	mov    $0x0,%edx
  801548:	b8 05 00 00 00       	mov    $0x5,%eax
  80154d:	e8 37 ff ff ff       	call   801489 <fsipc>
  801552:	85 c0                	test   %eax,%eax
  801554:	78 2c                	js     801582 <devfile_stat+0x58>
	strcpy(st->st_name, fsipcbuf.statRet.ret_name);
  801556:	83 ec 08             	sub    $0x8,%esp
  801559:	68 00 70 80 00       	push   $0x807000
  80155e:	53                   	push   %ebx
  80155f:	e8 03 f3 ff ff       	call   800867 <strcpy>
	st->st_size = fsipcbuf.statRet.ret_size;
  801564:	a1 80 70 80 00       	mov    0x807080,%eax
  801569:	89 83 80 00 00 00    	mov    %eax,0x80(%ebx)
	st->st_isdir = fsipcbuf.statRet.ret_isdir;
  80156f:	a1 84 70 80 00       	mov    0x807084,%eax
  801574:	89 83 84 00 00 00    	mov    %eax,0x84(%ebx)
	return 0;
  80157a:	83 c4 10             	add    $0x10,%esp
  80157d:	b8 00 00 00 00       	mov    $0x0,%eax
}
  801582:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  801585:	c9                   	leave  
  801586:	c3                   	ret    

00801587 <devfile_write>:
{
  801587:	f3 0f 1e fb          	endbr32 
  80158b:	55                   	push   %ebp
  80158c:	89 e5                	mov    %esp,%ebp
  80158e:	83 ec 0c             	sub    $0xc,%esp
  801591:	8b 45 10             	mov    0x10(%ebp),%eax
  801594:	3d f8 0f 00 00       	cmp    $0xff8,%eax
  801599:	ba f8 0f 00 00       	mov    $0xff8,%edx
  80159e:	0f 47 c2             	cmova  %edx,%eax
	fsipcbuf.write.req_fileid = fd->fd_file.id;
  8015a1:	8b 55 08             	mov    0x8(%ebp),%edx
  8015a4:	8b 52 0c             	mov    0xc(%edx),%edx
  8015a7:	89 15 00 70 80 00    	mov    %edx,0x807000
	fsipcbuf.write.req_n = n;
  8015ad:	a3 04 70 80 00       	mov    %eax,0x807004
	memmove(fsipcbuf.write.req_buf, buf, n);
  8015b2:	50                   	push   %eax
  8015b3:	ff 75 0c             	pushl  0xc(%ebp)
  8015b6:	68 08 70 80 00       	push   $0x807008
  8015bb:	e8 5d f4 ff ff       	call   800a1d <memmove>
	return fsipc(FSREQ_WRITE, NULL);}
  8015c0:	ba 00 00 00 00       	mov    $0x0,%edx
  8015c5:	b8 04 00 00 00       	mov    $0x4,%eax
  8015ca:	e8 ba fe ff ff       	call   801489 <fsipc>
  8015cf:	c9                   	leave  
  8015d0:	c3                   	ret    

008015d1 <devfile_read>:
{
  8015d1:	f3 0f 1e fb          	endbr32 
  8015d5:	55                   	push   %ebp
  8015d6:	89 e5                	mov    %esp,%ebp
  8015d8:	56                   	push   %esi
  8015d9:	53                   	push   %ebx
  8015da:	8b 75 10             	mov    0x10(%ebp),%esi
	fsipcbuf.read.req_fileid = fd->fd_file.id;
  8015dd:	8b 45 08             	mov    0x8(%ebp),%eax
  8015e0:	8b 40 0c             	mov    0xc(%eax),%eax
  8015e3:	a3 00 70 80 00       	mov    %eax,0x807000
	fsipcbuf.read.req_n = n;
  8015e8:	89 35 04 70 80 00    	mov    %esi,0x807004
	if ((r = fsipc(FSREQ_READ, NULL)) < 0)
  8015ee:	ba 00 00 00 00       	mov    $0x0,%edx
  8015f3:	b8 03 00 00 00       	mov    $0x3,%eax
  8015f8:	e8 8c fe ff ff       	call   801489 <fsipc>
  8015fd:	89 c3                	mov    %eax,%ebx
  8015ff:	85 c0                	test   %eax,%eax
  801601:	78 1f                	js     801622 <devfile_read+0x51>
	assert(r <= n);
  801603:	39 f0                	cmp    %esi,%eax
  801605:	77 24                	ja     80162b <devfile_read+0x5a>
	assert(r <= PGSIZE);
  801607:	3d 00 10 00 00       	cmp    $0x1000,%eax
  80160c:	7f 33                	jg     801641 <devfile_read+0x70>
	memmove(buf, fsipcbuf.readRet.ret_buf, r);
  80160e:	83 ec 04             	sub    $0x4,%esp
  801611:	50                   	push   %eax
  801612:	68 00 70 80 00       	push   $0x807000
  801617:	ff 75 0c             	pushl  0xc(%ebp)
  80161a:	e8 fe f3 ff ff       	call   800a1d <memmove>
	return r;
  80161f:	83 c4 10             	add    $0x10,%esp
}
  801622:	89 d8                	mov    %ebx,%eax
  801624:	8d 65 f8             	lea    -0x8(%ebp),%esp
  801627:	5b                   	pop    %ebx
  801628:	5e                   	pop    %esi
  801629:	5d                   	pop    %ebp
  80162a:	c3                   	ret    
	assert(r <= n);
  80162b:	68 18 25 80 00       	push   $0x802518
  801630:	68 1f 25 80 00       	push   $0x80251f
  801635:	6a 7c                	push   $0x7c
  801637:	68 34 25 80 00       	push   $0x802534
  80163c:	e8 66 eb ff ff       	call   8001a7 <_panic>
	assert(r <= PGSIZE);
  801641:	68 3f 25 80 00       	push   $0x80253f
  801646:	68 1f 25 80 00       	push   $0x80251f
  80164b:	6a 7d                	push   $0x7d
  80164d:	68 34 25 80 00       	push   $0x802534
  801652:	e8 50 eb ff ff       	call   8001a7 <_panic>

00801657 <open>:
{
  801657:	f3 0f 1e fb          	endbr32 
  80165b:	55                   	push   %ebp
  80165c:	89 e5                	mov    %esp,%ebp
  80165e:	56                   	push   %esi
  80165f:	53                   	push   %ebx
  801660:	83 ec 1c             	sub    $0x1c,%esp
  801663:	8b 75 08             	mov    0x8(%ebp),%esi
	if (strlen(path) >= MAXPATHLEN)
  801666:	56                   	push   %esi
  801667:	e8 b8 f1 ff ff       	call   800824 <strlen>
  80166c:	83 c4 10             	add    $0x10,%esp
  80166f:	3d ff 03 00 00       	cmp    $0x3ff,%eax
  801674:	7f 6c                	jg     8016e2 <open+0x8b>
	if ((r = fd_alloc(&fd)) < 0)
  801676:	83 ec 0c             	sub    $0xc,%esp
  801679:	8d 45 f4             	lea    -0xc(%ebp),%eax
  80167c:	50                   	push   %eax
  80167d:	e8 67 f8 ff ff       	call   800ee9 <fd_alloc>
  801682:	89 c3                	mov    %eax,%ebx
  801684:	83 c4 10             	add    $0x10,%esp
  801687:	85 c0                	test   %eax,%eax
  801689:	78 3c                	js     8016c7 <open+0x70>
	strcpy(fsipcbuf.open.req_path, path);
  80168b:	83 ec 08             	sub    $0x8,%esp
  80168e:	56                   	push   %esi
  80168f:	68 00 70 80 00       	push   $0x807000
  801694:	e8 ce f1 ff ff       	call   800867 <strcpy>
	fsipcbuf.open.req_omode = mode;
  801699:	8b 45 0c             	mov    0xc(%ebp),%eax
  80169c:	a3 00 74 80 00       	mov    %eax,0x807400
	if ((r = fsipc(FSREQ_OPEN, fd)) < 0) {
  8016a1:	8b 55 f4             	mov    -0xc(%ebp),%edx
  8016a4:	b8 01 00 00 00       	mov    $0x1,%eax
  8016a9:	e8 db fd ff ff       	call   801489 <fsipc>
  8016ae:	89 c3                	mov    %eax,%ebx
  8016b0:	83 c4 10             	add    $0x10,%esp
  8016b3:	85 c0                	test   %eax,%eax
  8016b5:	78 19                	js     8016d0 <open+0x79>
	return fd2num(fd);
  8016b7:	83 ec 0c             	sub    $0xc,%esp
  8016ba:	ff 75 f4             	pushl  -0xc(%ebp)
  8016bd:	e8 f8 f7 ff ff       	call   800eba <fd2num>
  8016c2:	89 c3                	mov    %eax,%ebx
  8016c4:	83 c4 10             	add    $0x10,%esp
}
  8016c7:	89 d8                	mov    %ebx,%eax
  8016c9:	8d 65 f8             	lea    -0x8(%ebp),%esp
  8016cc:	5b                   	pop    %ebx
  8016cd:	5e                   	pop    %esi
  8016ce:	5d                   	pop    %ebp
  8016cf:	c3                   	ret    
		fd_close(fd, 0);
  8016d0:	83 ec 08             	sub    $0x8,%esp
  8016d3:	6a 00                	push   $0x0
  8016d5:	ff 75 f4             	pushl  -0xc(%ebp)
  8016d8:	e8 10 f9 ff ff       	call   800fed <fd_close>
		return r;
  8016dd:	83 c4 10             	add    $0x10,%esp
  8016e0:	eb e5                	jmp    8016c7 <open+0x70>
		return -E_BAD_PATH;
  8016e2:	bb f4 ff ff ff       	mov    $0xfffffff4,%ebx
  8016e7:	eb de                	jmp    8016c7 <open+0x70>

008016e9 <sync>:


// Synchronize disk with buffer cache
int
sync(void)
{
  8016e9:	f3 0f 1e fb          	endbr32 
  8016ed:	55                   	push   %ebp
  8016ee:	89 e5                	mov    %esp,%ebp
  8016f0:	83 ec 08             	sub    $0x8,%esp
	// Ask the file server to update the disk
	// by writing any dirty blocks in the buffer cache.

	return fsipc(FSREQ_SYNC, NULL);
  8016f3:	ba 00 00 00 00       	mov    $0x0,%edx
  8016f8:	b8 08 00 00 00       	mov    $0x8,%eax
  8016fd:	e8 87 fd ff ff       	call   801489 <fsipc>
}
  801702:	c9                   	leave  
  801703:	c3                   	ret    

00801704 <writebuf>:


static void
writebuf(struct printbuf *b)
{
	if (b->error > 0) {
  801704:	83 78 0c 00          	cmpl   $0x0,0xc(%eax)
  801708:	7f 01                	jg     80170b <writebuf+0x7>
  80170a:	c3                   	ret    
{
  80170b:	55                   	push   %ebp
  80170c:	89 e5                	mov    %esp,%ebp
  80170e:	53                   	push   %ebx
  80170f:	83 ec 08             	sub    $0x8,%esp
  801712:	89 c3                	mov    %eax,%ebx
		ssize_t result = write(b->fd, b->buf, b->idx);
  801714:	ff 70 04             	pushl  0x4(%eax)
  801717:	8d 40 10             	lea    0x10(%eax),%eax
  80171a:	50                   	push   %eax
  80171b:	ff 33                	pushl  (%ebx)
  80171d:	e8 76 fb ff ff       	call   801298 <write>
		if (result > 0)
  801722:	83 c4 10             	add    $0x10,%esp
  801725:	85 c0                	test   %eax,%eax
  801727:	7e 03                	jle    80172c <writebuf+0x28>
			b->result += result;
  801729:	01 43 08             	add    %eax,0x8(%ebx)
		if (result != b->idx) // error, or wrote less than supplied
  80172c:	39 43 04             	cmp    %eax,0x4(%ebx)
  80172f:	74 0d                	je     80173e <writebuf+0x3a>
			b->error = (result < 0 ? result : 0);
  801731:	85 c0                	test   %eax,%eax
  801733:	ba 00 00 00 00       	mov    $0x0,%edx
  801738:	0f 4f c2             	cmovg  %edx,%eax
  80173b:	89 43 0c             	mov    %eax,0xc(%ebx)
	}
}
  80173e:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  801741:	c9                   	leave  
  801742:	c3                   	ret    

00801743 <putch>:

static void
putch(int ch, void *thunk)
{
  801743:	f3 0f 1e fb          	endbr32 
  801747:	55                   	push   %ebp
  801748:	89 e5                	mov    %esp,%ebp
  80174a:	53                   	push   %ebx
  80174b:	83 ec 04             	sub    $0x4,%esp
  80174e:	8b 5d 0c             	mov    0xc(%ebp),%ebx
	struct printbuf *b = (struct printbuf *) thunk;
	b->buf[b->idx++] = ch;
  801751:	8b 53 04             	mov    0x4(%ebx),%edx
  801754:	8d 42 01             	lea    0x1(%edx),%eax
  801757:	89 43 04             	mov    %eax,0x4(%ebx)
  80175a:	8b 4d 08             	mov    0x8(%ebp),%ecx
  80175d:	88 4c 13 10          	mov    %cl,0x10(%ebx,%edx,1)
	if (b->idx == 256) {
  801761:	3d 00 01 00 00       	cmp    $0x100,%eax
  801766:	74 06                	je     80176e <putch+0x2b>
		writebuf(b);
		b->idx = 0;
	}
}
  801768:	83 c4 04             	add    $0x4,%esp
  80176b:	5b                   	pop    %ebx
  80176c:	5d                   	pop    %ebp
  80176d:	c3                   	ret    
		writebuf(b);
  80176e:	89 d8                	mov    %ebx,%eax
  801770:	e8 8f ff ff ff       	call   801704 <writebuf>
		b->idx = 0;
  801775:	c7 43 04 00 00 00 00 	movl   $0x0,0x4(%ebx)
}
  80177c:	eb ea                	jmp    801768 <putch+0x25>

0080177e <vfprintf>:

int
vfprintf(int fd, const char *fmt, va_list ap)
{
  80177e:	f3 0f 1e fb          	endbr32 
  801782:	55                   	push   %ebp
  801783:	89 e5                	mov    %esp,%ebp
  801785:	81 ec 18 01 00 00    	sub    $0x118,%esp
	struct printbuf b;

	b.fd = fd;
  80178b:	8b 45 08             	mov    0x8(%ebp),%eax
  80178e:	89 85 e8 fe ff ff    	mov    %eax,-0x118(%ebp)
	b.idx = 0;
  801794:	c7 85 ec fe ff ff 00 	movl   $0x0,-0x114(%ebp)
  80179b:	00 00 00 
	b.result = 0;
  80179e:	c7 85 f0 fe ff ff 00 	movl   $0x0,-0x110(%ebp)
  8017a5:	00 00 00 
	b.error = 1;
  8017a8:	c7 85 f4 fe ff ff 01 	movl   $0x1,-0x10c(%ebp)
  8017af:	00 00 00 
	vprintfmt(putch, &b, fmt, ap);
  8017b2:	ff 75 10             	pushl  0x10(%ebp)
  8017b5:	ff 75 0c             	pushl  0xc(%ebp)
  8017b8:	8d 85 e8 fe ff ff    	lea    -0x118(%ebp),%eax
  8017be:	50                   	push   %eax
  8017bf:	68 43 17 80 00       	push   $0x801743
  8017c4:	e8 c8 eb ff ff       	call   800391 <vprintfmt>
	if (b.idx > 0)
  8017c9:	83 c4 10             	add    $0x10,%esp
  8017cc:	83 bd ec fe ff ff 00 	cmpl   $0x0,-0x114(%ebp)
  8017d3:	7f 11                	jg     8017e6 <vfprintf+0x68>
		writebuf(&b);

	return (b.result ? b.result : b.error);
  8017d5:	8b 85 f0 fe ff ff    	mov    -0x110(%ebp),%eax
  8017db:	85 c0                	test   %eax,%eax
  8017dd:	0f 44 85 f4 fe ff ff 	cmove  -0x10c(%ebp),%eax
}
  8017e4:	c9                   	leave  
  8017e5:	c3                   	ret    
		writebuf(&b);
  8017e6:	8d 85 e8 fe ff ff    	lea    -0x118(%ebp),%eax
  8017ec:	e8 13 ff ff ff       	call   801704 <writebuf>
  8017f1:	eb e2                	jmp    8017d5 <vfprintf+0x57>

008017f3 <fprintf>:

int
fprintf(int fd, const char *fmt, ...)
{
  8017f3:	f3 0f 1e fb          	endbr32 
  8017f7:	55                   	push   %ebp
  8017f8:	89 e5                	mov    %esp,%ebp
  8017fa:	83 ec 0c             	sub    $0xc,%esp
	va_list ap;
	int cnt;

	va_start(ap, fmt);
  8017fd:	8d 45 10             	lea    0x10(%ebp),%eax
	cnt = vfprintf(fd, fmt, ap);
  801800:	50                   	push   %eax
  801801:	ff 75 0c             	pushl  0xc(%ebp)
  801804:	ff 75 08             	pushl  0x8(%ebp)
  801807:	e8 72 ff ff ff       	call   80177e <vfprintf>
	va_end(ap);

	return cnt;
}
  80180c:	c9                   	leave  
  80180d:	c3                   	ret    

0080180e <printf>:

int
printf(const char *fmt, ...)
{
  80180e:	f3 0f 1e fb          	endbr32 
  801812:	55                   	push   %ebp
  801813:	89 e5                	mov    %esp,%ebp
  801815:	83 ec 0c             	sub    $0xc,%esp
	va_list ap;
	int cnt;

	va_start(ap, fmt);
  801818:	8d 45 0c             	lea    0xc(%ebp),%eax
	cnt = vfprintf(1, fmt, ap);
  80181b:	50                   	push   %eax
  80181c:	ff 75 08             	pushl  0x8(%ebp)
  80181f:	6a 01                	push   $0x1
  801821:	e8 58 ff ff ff       	call   80177e <vfprintf>
	va_end(ap);

	return cnt;
}
  801826:	c9                   	leave  
  801827:	c3                   	ret    

00801828 <devpipe_stat>:
	return i;
}

static int
devpipe_stat(struct Fd *fd, struct Stat *stat)
{
  801828:	f3 0f 1e fb          	endbr32 
  80182c:	55                   	push   %ebp
  80182d:	89 e5                	mov    %esp,%ebp
  80182f:	56                   	push   %esi
  801830:	53                   	push   %ebx
  801831:	8b 5d 0c             	mov    0xc(%ebp),%ebx
	struct Pipe *p = (struct Pipe*) fd2data(fd);
  801834:	83 ec 0c             	sub    $0xc,%esp
  801837:	ff 75 08             	pushl  0x8(%ebp)
  80183a:	e8 8f f6 ff ff       	call   800ece <fd2data>
  80183f:	89 c6                	mov    %eax,%esi
	strcpy(stat->st_name, "<pipe>");
  801841:	83 c4 08             	add    $0x8,%esp
  801844:	68 4b 25 80 00       	push   $0x80254b
  801849:	53                   	push   %ebx
  80184a:	e8 18 f0 ff ff       	call   800867 <strcpy>
	stat->st_size = p->p_wpos - p->p_rpos;
  80184f:	8b 46 04             	mov    0x4(%esi),%eax
  801852:	2b 06                	sub    (%esi),%eax
  801854:	89 83 80 00 00 00    	mov    %eax,0x80(%ebx)
	stat->st_isdir = 0;
  80185a:	c7 83 84 00 00 00 00 	movl   $0x0,0x84(%ebx)
  801861:	00 00 00 
	stat->st_dev = &devpipe;
  801864:	c7 83 88 00 00 00 20 	movl   $0x803020,0x88(%ebx)
  80186b:	30 80 00 
	return 0;
}
  80186e:	b8 00 00 00 00       	mov    $0x0,%eax
  801873:	8d 65 f8             	lea    -0x8(%ebp),%esp
  801876:	5b                   	pop    %ebx
  801877:	5e                   	pop    %esi
  801878:	5d                   	pop    %ebp
  801879:	c3                   	ret    

0080187a <devpipe_close>:

static int
devpipe_close(struct Fd *fd)
{
  80187a:	f3 0f 1e fb          	endbr32 
  80187e:	55                   	push   %ebp
  80187f:	89 e5                	mov    %esp,%ebp
  801881:	53                   	push   %ebx
  801882:	83 ec 0c             	sub    $0xc,%esp
  801885:	8b 5d 08             	mov    0x8(%ebp),%ebx
	(void) sys_page_unmap(0, fd);
  801888:	53                   	push   %ebx
  801889:	6a 00                	push   $0x0
  80188b:	e8 a6 f4 ff ff       	call   800d36 <sys_page_unmap>
	return sys_page_unmap(0, fd2data(fd));
  801890:	89 1c 24             	mov    %ebx,(%esp)
  801893:	e8 36 f6 ff ff       	call   800ece <fd2data>
  801898:	83 c4 08             	add    $0x8,%esp
  80189b:	50                   	push   %eax
  80189c:	6a 00                	push   $0x0
  80189e:	e8 93 f4 ff ff       	call   800d36 <sys_page_unmap>
}
  8018a3:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  8018a6:	c9                   	leave  
  8018a7:	c3                   	ret    

008018a8 <_pipeisclosed>:
{
  8018a8:	55                   	push   %ebp
  8018a9:	89 e5                	mov    %esp,%ebp
  8018ab:	57                   	push   %edi
  8018ac:	56                   	push   %esi
  8018ad:	53                   	push   %ebx
  8018ae:	83 ec 1c             	sub    $0x1c,%esp
  8018b1:	89 c7                	mov    %eax,%edi
  8018b3:	89 d6                	mov    %edx,%esi
		n = thisenv->env_runs;
  8018b5:	a1 20 60 80 00       	mov    0x806020,%eax
  8018ba:	8b 58 58             	mov    0x58(%eax),%ebx
		ret = pageref(fd) == pageref(p);
  8018bd:	83 ec 0c             	sub    $0xc,%esp
  8018c0:	57                   	push   %edi
  8018c1:	e8 73 05 00 00       	call   801e39 <pageref>
  8018c6:	89 45 e4             	mov    %eax,-0x1c(%ebp)
  8018c9:	89 34 24             	mov    %esi,(%esp)
  8018cc:	e8 68 05 00 00       	call   801e39 <pageref>
		nn = thisenv->env_runs;
  8018d1:	8b 15 20 60 80 00    	mov    0x806020,%edx
  8018d7:	8b 4a 58             	mov    0x58(%edx),%ecx
		if (n == nn)
  8018da:	83 c4 10             	add    $0x10,%esp
  8018dd:	39 cb                	cmp    %ecx,%ebx
  8018df:	74 1b                	je     8018fc <_pipeisclosed+0x54>
		if (n != nn && ret == 1)
  8018e1:	39 45 e4             	cmp    %eax,-0x1c(%ebp)
  8018e4:	75 cf                	jne    8018b5 <_pipeisclosed+0xd>
			cprintf("pipe race avoided\n", n, thisenv->env_runs, ret);
  8018e6:	8b 42 58             	mov    0x58(%edx),%eax
  8018e9:	6a 01                	push   $0x1
  8018eb:	50                   	push   %eax
  8018ec:	53                   	push   %ebx
  8018ed:	68 52 25 80 00       	push   $0x802552
  8018f2:	e8 97 e9 ff ff       	call   80028e <cprintf>
  8018f7:	83 c4 10             	add    $0x10,%esp
  8018fa:	eb b9                	jmp    8018b5 <_pipeisclosed+0xd>
		ret = pageref(fd) == pageref(p);
  8018fc:	39 45 e4             	cmp    %eax,-0x1c(%ebp)
  8018ff:	0f 94 c0             	sete   %al
  801902:	0f b6 c0             	movzbl %al,%eax
}
  801905:	8d 65 f4             	lea    -0xc(%ebp),%esp
  801908:	5b                   	pop    %ebx
  801909:	5e                   	pop    %esi
  80190a:	5f                   	pop    %edi
  80190b:	5d                   	pop    %ebp
  80190c:	c3                   	ret    

0080190d <devpipe_write>:
{
  80190d:	f3 0f 1e fb          	endbr32 
  801911:	55                   	push   %ebp
  801912:	89 e5                	mov    %esp,%ebp
  801914:	57                   	push   %edi
  801915:	56                   	push   %esi
  801916:	53                   	push   %ebx
  801917:	83 ec 28             	sub    $0x28,%esp
  80191a:	8b 75 08             	mov    0x8(%ebp),%esi
	p = (struct Pipe*) fd2data(fd);
  80191d:	56                   	push   %esi
  80191e:	e8 ab f5 ff ff       	call   800ece <fd2data>
  801923:	89 c3                	mov    %eax,%ebx
	for (i = 0; i < n; i++) {
  801925:	83 c4 10             	add    $0x10,%esp
  801928:	bf 00 00 00 00       	mov    $0x0,%edi
  80192d:	3b 7d 10             	cmp    0x10(%ebp),%edi
  801930:	74 4f                	je     801981 <devpipe_write+0x74>
		while (p->p_wpos >= p->p_rpos + sizeof(p->p_buf)) {
  801932:	8b 43 04             	mov    0x4(%ebx),%eax
  801935:	8b 0b                	mov    (%ebx),%ecx
  801937:	8d 51 20             	lea    0x20(%ecx),%edx
  80193a:	39 d0                	cmp    %edx,%eax
  80193c:	72 14                	jb     801952 <devpipe_write+0x45>
			if (_pipeisclosed(fd, p))
  80193e:	89 da                	mov    %ebx,%edx
  801940:	89 f0                	mov    %esi,%eax
  801942:	e8 61 ff ff ff       	call   8018a8 <_pipeisclosed>
  801947:	85 c0                	test   %eax,%eax
  801949:	75 3b                	jne    801986 <devpipe_write+0x79>
			sys_yield();
  80194b:	e8 36 f3 ff ff       	call   800c86 <sys_yield>
  801950:	eb e0                	jmp    801932 <devpipe_write+0x25>
		p->p_buf[p->p_wpos % PIPEBUFSIZ] = buf[i];
  801952:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  801955:	0f b6 0c 39          	movzbl (%ecx,%edi,1),%ecx
  801959:	88 4d e7             	mov    %cl,-0x19(%ebp)
  80195c:	89 c2                	mov    %eax,%edx
  80195e:	c1 fa 1f             	sar    $0x1f,%edx
  801961:	89 d1                	mov    %edx,%ecx
  801963:	c1 e9 1b             	shr    $0x1b,%ecx
  801966:	8d 14 08             	lea    (%eax,%ecx,1),%edx
  801969:	83 e2 1f             	and    $0x1f,%edx
  80196c:	29 ca                	sub    %ecx,%edx
  80196e:	0f b6 4d e7          	movzbl -0x19(%ebp),%ecx
  801972:	88 4c 13 08          	mov    %cl,0x8(%ebx,%edx,1)
		p->p_wpos++;
  801976:	83 c0 01             	add    $0x1,%eax
  801979:	89 43 04             	mov    %eax,0x4(%ebx)
	for (i = 0; i < n; i++) {
  80197c:	83 c7 01             	add    $0x1,%edi
  80197f:	eb ac                	jmp    80192d <devpipe_write+0x20>
	return i;
  801981:	8b 45 10             	mov    0x10(%ebp),%eax
  801984:	eb 05                	jmp    80198b <devpipe_write+0x7e>
				return 0;
  801986:	b8 00 00 00 00       	mov    $0x0,%eax
}
  80198b:	8d 65 f4             	lea    -0xc(%ebp),%esp
  80198e:	5b                   	pop    %ebx
  80198f:	5e                   	pop    %esi
  801990:	5f                   	pop    %edi
  801991:	5d                   	pop    %ebp
  801992:	c3                   	ret    

00801993 <devpipe_read>:
{
  801993:	f3 0f 1e fb          	endbr32 
  801997:	55                   	push   %ebp
  801998:	89 e5                	mov    %esp,%ebp
  80199a:	57                   	push   %edi
  80199b:	56                   	push   %esi
  80199c:	53                   	push   %ebx
  80199d:	83 ec 18             	sub    $0x18,%esp
  8019a0:	8b 7d 08             	mov    0x8(%ebp),%edi
	p = (struct Pipe*)fd2data(fd);
  8019a3:	57                   	push   %edi
  8019a4:	e8 25 f5 ff ff       	call   800ece <fd2data>
  8019a9:	89 c3                	mov    %eax,%ebx
	for (i = 0; i < n; i++) {
  8019ab:	83 c4 10             	add    $0x10,%esp
  8019ae:	be 00 00 00 00       	mov    $0x0,%esi
  8019b3:	3b 75 10             	cmp    0x10(%ebp),%esi
  8019b6:	75 14                	jne    8019cc <devpipe_read+0x39>
	return i;
  8019b8:	8b 45 10             	mov    0x10(%ebp),%eax
  8019bb:	eb 02                	jmp    8019bf <devpipe_read+0x2c>
				return i;
  8019bd:	89 f0                	mov    %esi,%eax
}
  8019bf:	8d 65 f4             	lea    -0xc(%ebp),%esp
  8019c2:	5b                   	pop    %ebx
  8019c3:	5e                   	pop    %esi
  8019c4:	5f                   	pop    %edi
  8019c5:	5d                   	pop    %ebp
  8019c6:	c3                   	ret    
			sys_yield();
  8019c7:	e8 ba f2 ff ff       	call   800c86 <sys_yield>
		while (p->p_rpos == p->p_wpos) {
  8019cc:	8b 03                	mov    (%ebx),%eax
  8019ce:	3b 43 04             	cmp    0x4(%ebx),%eax
  8019d1:	75 18                	jne    8019eb <devpipe_read+0x58>
			if (i > 0)
  8019d3:	85 f6                	test   %esi,%esi
  8019d5:	75 e6                	jne    8019bd <devpipe_read+0x2a>
			if (_pipeisclosed(fd, p))
  8019d7:	89 da                	mov    %ebx,%edx
  8019d9:	89 f8                	mov    %edi,%eax
  8019db:	e8 c8 fe ff ff       	call   8018a8 <_pipeisclosed>
  8019e0:	85 c0                	test   %eax,%eax
  8019e2:	74 e3                	je     8019c7 <devpipe_read+0x34>
				return 0;
  8019e4:	b8 00 00 00 00       	mov    $0x0,%eax
  8019e9:	eb d4                	jmp    8019bf <devpipe_read+0x2c>
		buf[i] = p->p_buf[p->p_rpos % PIPEBUFSIZ];
  8019eb:	99                   	cltd   
  8019ec:	c1 ea 1b             	shr    $0x1b,%edx
  8019ef:	01 d0                	add    %edx,%eax
  8019f1:	83 e0 1f             	and    $0x1f,%eax
  8019f4:	29 d0                	sub    %edx,%eax
  8019f6:	0f b6 44 03 08       	movzbl 0x8(%ebx,%eax,1),%eax
  8019fb:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  8019fe:	88 04 31             	mov    %al,(%ecx,%esi,1)
		p->p_rpos++;
  801a01:	83 03 01             	addl   $0x1,(%ebx)
	for (i = 0; i < n; i++) {
  801a04:	83 c6 01             	add    $0x1,%esi
  801a07:	eb aa                	jmp    8019b3 <devpipe_read+0x20>

00801a09 <pipe>:
{
  801a09:	f3 0f 1e fb          	endbr32 
  801a0d:	55                   	push   %ebp
  801a0e:	89 e5                	mov    %esp,%ebp
  801a10:	56                   	push   %esi
  801a11:	53                   	push   %ebx
  801a12:	83 ec 1c             	sub    $0x1c,%esp
	if ((r = fd_alloc(&fd0)) < 0
  801a15:	8d 45 f4             	lea    -0xc(%ebp),%eax
  801a18:	50                   	push   %eax
  801a19:	e8 cb f4 ff ff       	call   800ee9 <fd_alloc>
  801a1e:	89 c3                	mov    %eax,%ebx
  801a20:	83 c4 10             	add    $0x10,%esp
  801a23:	85 c0                	test   %eax,%eax
  801a25:	0f 88 23 01 00 00    	js     801b4e <pipe+0x145>
	    || (r = sys_page_alloc(0, fd0, PTE_P|PTE_W|PTE_U|PTE_SHARE)) < 0)
  801a2b:	83 ec 04             	sub    $0x4,%esp
  801a2e:	68 07 04 00 00       	push   $0x407
  801a33:	ff 75 f4             	pushl  -0xc(%ebp)
  801a36:	6a 00                	push   $0x0
  801a38:	e8 6c f2 ff ff       	call   800ca9 <sys_page_alloc>
  801a3d:	89 c3                	mov    %eax,%ebx
  801a3f:	83 c4 10             	add    $0x10,%esp
  801a42:	85 c0                	test   %eax,%eax
  801a44:	0f 88 04 01 00 00    	js     801b4e <pipe+0x145>
	if ((r = fd_alloc(&fd1)) < 0
  801a4a:	83 ec 0c             	sub    $0xc,%esp
  801a4d:	8d 45 f0             	lea    -0x10(%ebp),%eax
  801a50:	50                   	push   %eax
  801a51:	e8 93 f4 ff ff       	call   800ee9 <fd_alloc>
  801a56:	89 c3                	mov    %eax,%ebx
  801a58:	83 c4 10             	add    $0x10,%esp
  801a5b:	85 c0                	test   %eax,%eax
  801a5d:	0f 88 db 00 00 00    	js     801b3e <pipe+0x135>
	    || (r = sys_page_alloc(0, fd1, PTE_P|PTE_W|PTE_U|PTE_SHARE)) < 0)
  801a63:	83 ec 04             	sub    $0x4,%esp
  801a66:	68 07 04 00 00       	push   $0x407
  801a6b:	ff 75 f0             	pushl  -0x10(%ebp)
  801a6e:	6a 00                	push   $0x0
  801a70:	e8 34 f2 ff ff       	call   800ca9 <sys_page_alloc>
  801a75:	89 c3                	mov    %eax,%ebx
  801a77:	83 c4 10             	add    $0x10,%esp
  801a7a:	85 c0                	test   %eax,%eax
  801a7c:	0f 88 bc 00 00 00    	js     801b3e <pipe+0x135>
	va = fd2data(fd0);
  801a82:	83 ec 0c             	sub    $0xc,%esp
  801a85:	ff 75 f4             	pushl  -0xc(%ebp)
  801a88:	e8 41 f4 ff ff       	call   800ece <fd2data>
  801a8d:	89 c6                	mov    %eax,%esi
	if ((r = sys_page_alloc(0, va, PTE_P|PTE_W|PTE_U|PTE_SHARE)) < 0)
  801a8f:	83 c4 0c             	add    $0xc,%esp
  801a92:	68 07 04 00 00       	push   $0x407
  801a97:	50                   	push   %eax
  801a98:	6a 00                	push   $0x0
  801a9a:	e8 0a f2 ff ff       	call   800ca9 <sys_page_alloc>
  801a9f:	89 c3                	mov    %eax,%ebx
  801aa1:	83 c4 10             	add    $0x10,%esp
  801aa4:	85 c0                	test   %eax,%eax
  801aa6:	0f 88 82 00 00 00    	js     801b2e <pipe+0x125>
	if ((r = sys_page_map(0, va, 0, fd2data(fd1), PTE_P|PTE_W|PTE_U|PTE_SHARE)) < 0)
  801aac:	83 ec 0c             	sub    $0xc,%esp
  801aaf:	ff 75 f0             	pushl  -0x10(%ebp)
  801ab2:	e8 17 f4 ff ff       	call   800ece <fd2data>
  801ab7:	c7 04 24 07 04 00 00 	movl   $0x407,(%esp)
  801abe:	50                   	push   %eax
  801abf:	6a 00                	push   $0x0
  801ac1:	56                   	push   %esi
  801ac2:	6a 00                	push   $0x0
  801ac4:	e8 27 f2 ff ff       	call   800cf0 <sys_page_map>
  801ac9:	89 c3                	mov    %eax,%ebx
  801acb:	83 c4 20             	add    $0x20,%esp
  801ace:	85 c0                	test   %eax,%eax
  801ad0:	78 4e                	js     801b20 <pipe+0x117>
	fd0->fd_dev_id = devpipe.dev_id;
  801ad2:	a1 20 30 80 00       	mov    0x803020,%eax
  801ad7:	8b 55 f4             	mov    -0xc(%ebp),%edx
  801ada:	89 02                	mov    %eax,(%edx)
	fd0->fd_omode = O_RDONLY;
  801adc:	8b 55 f4             	mov    -0xc(%ebp),%edx
  801adf:	c7 42 08 00 00 00 00 	movl   $0x0,0x8(%edx)
	fd1->fd_dev_id = devpipe.dev_id;
  801ae6:	8b 55 f0             	mov    -0x10(%ebp),%edx
  801ae9:	89 02                	mov    %eax,(%edx)
	fd1->fd_omode = O_WRONLY;
  801aeb:	8b 45 f0             	mov    -0x10(%ebp),%eax
  801aee:	c7 40 08 01 00 00 00 	movl   $0x1,0x8(%eax)
	pfd[0] = fd2num(fd0);
  801af5:	83 ec 0c             	sub    $0xc,%esp
  801af8:	ff 75 f4             	pushl  -0xc(%ebp)
  801afb:	e8 ba f3 ff ff       	call   800eba <fd2num>
  801b00:	8b 4d 08             	mov    0x8(%ebp),%ecx
  801b03:	89 01                	mov    %eax,(%ecx)
	pfd[1] = fd2num(fd1);
  801b05:	83 c4 04             	add    $0x4,%esp
  801b08:	ff 75 f0             	pushl  -0x10(%ebp)
  801b0b:	e8 aa f3 ff ff       	call   800eba <fd2num>
  801b10:	8b 4d 08             	mov    0x8(%ebp),%ecx
  801b13:	89 41 04             	mov    %eax,0x4(%ecx)
	return 0;
  801b16:	83 c4 10             	add    $0x10,%esp
  801b19:	bb 00 00 00 00       	mov    $0x0,%ebx
  801b1e:	eb 2e                	jmp    801b4e <pipe+0x145>
	sys_page_unmap(0, va);
  801b20:	83 ec 08             	sub    $0x8,%esp
  801b23:	56                   	push   %esi
  801b24:	6a 00                	push   $0x0
  801b26:	e8 0b f2 ff ff       	call   800d36 <sys_page_unmap>
  801b2b:	83 c4 10             	add    $0x10,%esp
	sys_page_unmap(0, fd1);
  801b2e:	83 ec 08             	sub    $0x8,%esp
  801b31:	ff 75 f0             	pushl  -0x10(%ebp)
  801b34:	6a 00                	push   $0x0
  801b36:	e8 fb f1 ff ff       	call   800d36 <sys_page_unmap>
  801b3b:	83 c4 10             	add    $0x10,%esp
	sys_page_unmap(0, fd0);
  801b3e:	83 ec 08             	sub    $0x8,%esp
  801b41:	ff 75 f4             	pushl  -0xc(%ebp)
  801b44:	6a 00                	push   $0x0
  801b46:	e8 eb f1 ff ff       	call   800d36 <sys_page_unmap>
  801b4b:	83 c4 10             	add    $0x10,%esp
}
  801b4e:	89 d8                	mov    %ebx,%eax
  801b50:	8d 65 f8             	lea    -0x8(%ebp),%esp
  801b53:	5b                   	pop    %ebx
  801b54:	5e                   	pop    %esi
  801b55:	5d                   	pop    %ebp
  801b56:	c3                   	ret    

00801b57 <pipeisclosed>:
{
  801b57:	f3 0f 1e fb          	endbr32 
  801b5b:	55                   	push   %ebp
  801b5c:	89 e5                	mov    %esp,%ebp
  801b5e:	83 ec 20             	sub    $0x20,%esp
	if ((r = fd_lookup(fdnum, &fd)) < 0)
  801b61:	8d 45 f4             	lea    -0xc(%ebp),%eax
  801b64:	50                   	push   %eax
  801b65:	ff 75 08             	pushl  0x8(%ebp)
  801b68:	e8 d2 f3 ff ff       	call   800f3f <fd_lookup>
  801b6d:	83 c4 10             	add    $0x10,%esp
  801b70:	85 c0                	test   %eax,%eax
  801b72:	78 18                	js     801b8c <pipeisclosed+0x35>
	p = (struct Pipe*) fd2data(fd);
  801b74:	83 ec 0c             	sub    $0xc,%esp
  801b77:	ff 75 f4             	pushl  -0xc(%ebp)
  801b7a:	e8 4f f3 ff ff       	call   800ece <fd2data>
  801b7f:	89 c2                	mov    %eax,%edx
	return _pipeisclosed(fd, p);
  801b81:	8b 45 f4             	mov    -0xc(%ebp),%eax
  801b84:	e8 1f fd ff ff       	call   8018a8 <_pipeisclosed>
  801b89:	83 c4 10             	add    $0x10,%esp
}
  801b8c:	c9                   	leave  
  801b8d:	c3                   	ret    

00801b8e <devcons_close>:
	return tot;
}

static int
devcons_close(struct Fd *fd)
{
  801b8e:	f3 0f 1e fb          	endbr32 
	USED(fd);

	return 0;
}
  801b92:	b8 00 00 00 00       	mov    $0x0,%eax
  801b97:	c3                   	ret    

00801b98 <devcons_stat>:

static int
devcons_stat(struct Fd *fd, struct Stat *stat)
{
  801b98:	f3 0f 1e fb          	endbr32 
  801b9c:	55                   	push   %ebp
  801b9d:	89 e5                	mov    %esp,%ebp
  801b9f:	83 ec 10             	sub    $0x10,%esp
	strcpy(stat->st_name, "<cons>");
  801ba2:	68 6a 25 80 00       	push   $0x80256a
  801ba7:	ff 75 0c             	pushl  0xc(%ebp)
  801baa:	e8 b8 ec ff ff       	call   800867 <strcpy>
	return 0;
}
  801baf:	b8 00 00 00 00       	mov    $0x0,%eax
  801bb4:	c9                   	leave  
  801bb5:	c3                   	ret    

00801bb6 <devcons_write>:
{
  801bb6:	f3 0f 1e fb          	endbr32 
  801bba:	55                   	push   %ebp
  801bbb:	89 e5                	mov    %esp,%ebp
  801bbd:	57                   	push   %edi
  801bbe:	56                   	push   %esi
  801bbf:	53                   	push   %ebx
  801bc0:	81 ec 8c 00 00 00    	sub    $0x8c,%esp
	for (tot = 0; tot < n; tot += m) {
  801bc6:	be 00 00 00 00       	mov    $0x0,%esi
		memmove(buf, (char*)vbuf + tot, m);
  801bcb:	8d bd 68 ff ff ff    	lea    -0x98(%ebp),%edi
	for (tot = 0; tot < n; tot += m) {
  801bd1:	3b 75 10             	cmp    0x10(%ebp),%esi
  801bd4:	73 31                	jae    801c07 <devcons_write+0x51>
		m = n - tot;
  801bd6:	8b 5d 10             	mov    0x10(%ebp),%ebx
  801bd9:	29 f3                	sub    %esi,%ebx
  801bdb:	83 fb 7f             	cmp    $0x7f,%ebx
  801bde:	b8 7f 00 00 00       	mov    $0x7f,%eax
  801be3:	0f 47 d8             	cmova  %eax,%ebx
		memmove(buf, (char*)vbuf + tot, m);
  801be6:	83 ec 04             	sub    $0x4,%esp
  801be9:	53                   	push   %ebx
  801bea:	89 f0                	mov    %esi,%eax
  801bec:	03 45 0c             	add    0xc(%ebp),%eax
  801bef:	50                   	push   %eax
  801bf0:	57                   	push   %edi
  801bf1:	e8 27 ee ff ff       	call   800a1d <memmove>
		sys_cputs(buf, m);
  801bf6:	83 c4 08             	add    $0x8,%esp
  801bf9:	53                   	push   %ebx
  801bfa:	57                   	push   %edi
  801bfb:	e8 d9 ef ff ff       	call   800bd9 <sys_cputs>
	for (tot = 0; tot < n; tot += m) {
  801c00:	01 de                	add    %ebx,%esi
  801c02:	83 c4 10             	add    $0x10,%esp
  801c05:	eb ca                	jmp    801bd1 <devcons_write+0x1b>
}
  801c07:	89 f0                	mov    %esi,%eax
  801c09:	8d 65 f4             	lea    -0xc(%ebp),%esp
  801c0c:	5b                   	pop    %ebx
  801c0d:	5e                   	pop    %esi
  801c0e:	5f                   	pop    %edi
  801c0f:	5d                   	pop    %ebp
  801c10:	c3                   	ret    

00801c11 <devcons_read>:
{
  801c11:	f3 0f 1e fb          	endbr32 
  801c15:	55                   	push   %ebp
  801c16:	89 e5                	mov    %esp,%ebp
  801c18:	83 ec 08             	sub    $0x8,%esp
  801c1b:	b8 00 00 00 00       	mov    $0x0,%eax
	if (n == 0)
  801c20:	83 7d 10 00          	cmpl   $0x0,0x10(%ebp)
  801c24:	74 21                	je     801c47 <devcons_read+0x36>
	while ((c = sys_cgetc()) == 0)
  801c26:	e8 d0 ef ff ff       	call   800bfb <sys_cgetc>
  801c2b:	85 c0                	test   %eax,%eax
  801c2d:	75 07                	jne    801c36 <devcons_read+0x25>
		sys_yield();
  801c2f:	e8 52 f0 ff ff       	call   800c86 <sys_yield>
  801c34:	eb f0                	jmp    801c26 <devcons_read+0x15>
	if (c < 0)
  801c36:	78 0f                	js     801c47 <devcons_read+0x36>
	if (c == 0x04)	// ctl-d is eof
  801c38:	83 f8 04             	cmp    $0x4,%eax
  801c3b:	74 0c                	je     801c49 <devcons_read+0x38>
	*(char*)vbuf = c;
  801c3d:	8b 55 0c             	mov    0xc(%ebp),%edx
  801c40:	88 02                	mov    %al,(%edx)
	return 1;
  801c42:	b8 01 00 00 00       	mov    $0x1,%eax
}
  801c47:	c9                   	leave  
  801c48:	c3                   	ret    
		return 0;
  801c49:	b8 00 00 00 00       	mov    $0x0,%eax
  801c4e:	eb f7                	jmp    801c47 <devcons_read+0x36>

00801c50 <cputchar>:
{
  801c50:	f3 0f 1e fb          	endbr32 
  801c54:	55                   	push   %ebp
  801c55:	89 e5                	mov    %esp,%ebp
  801c57:	83 ec 20             	sub    $0x20,%esp
	char c = ch;
  801c5a:	8b 45 08             	mov    0x8(%ebp),%eax
  801c5d:	88 45 f7             	mov    %al,-0x9(%ebp)
	sys_cputs(&c, 1);
  801c60:	6a 01                	push   $0x1
  801c62:	8d 45 f7             	lea    -0x9(%ebp),%eax
  801c65:	50                   	push   %eax
  801c66:	e8 6e ef ff ff       	call   800bd9 <sys_cputs>
}
  801c6b:	83 c4 10             	add    $0x10,%esp
  801c6e:	c9                   	leave  
  801c6f:	c3                   	ret    

00801c70 <getchar>:
{
  801c70:	f3 0f 1e fb          	endbr32 
  801c74:	55                   	push   %ebp
  801c75:	89 e5                	mov    %esp,%ebp
  801c77:	83 ec 1c             	sub    $0x1c,%esp
	r = read(0, &c, 1);
  801c7a:	6a 01                	push   $0x1
  801c7c:	8d 45 f7             	lea    -0x9(%ebp),%eax
  801c7f:	50                   	push   %eax
  801c80:	6a 00                	push   $0x0
  801c82:	e8 3b f5 ff ff       	call   8011c2 <read>
	if (r < 0)
  801c87:	83 c4 10             	add    $0x10,%esp
  801c8a:	85 c0                	test   %eax,%eax
  801c8c:	78 06                	js     801c94 <getchar+0x24>
	if (r < 1)
  801c8e:	74 06                	je     801c96 <getchar+0x26>
	return c;
  801c90:	0f b6 45 f7          	movzbl -0x9(%ebp),%eax
}
  801c94:	c9                   	leave  
  801c95:	c3                   	ret    
		return -E_EOF;
  801c96:	b8 f8 ff ff ff       	mov    $0xfffffff8,%eax
  801c9b:	eb f7                	jmp    801c94 <getchar+0x24>

00801c9d <iscons>:
{
  801c9d:	f3 0f 1e fb          	endbr32 
  801ca1:	55                   	push   %ebp
  801ca2:	89 e5                	mov    %esp,%ebp
  801ca4:	83 ec 20             	sub    $0x20,%esp
	if ((r = fd_lookup(fdnum, &fd)) < 0)
  801ca7:	8d 45 f4             	lea    -0xc(%ebp),%eax
  801caa:	50                   	push   %eax
  801cab:	ff 75 08             	pushl  0x8(%ebp)
  801cae:	e8 8c f2 ff ff       	call   800f3f <fd_lookup>
  801cb3:	83 c4 10             	add    $0x10,%esp
  801cb6:	85 c0                	test   %eax,%eax
  801cb8:	78 11                	js     801ccb <iscons+0x2e>
	return fd->fd_dev_id == devcons.dev_id;
  801cba:	8b 45 f4             	mov    -0xc(%ebp),%eax
  801cbd:	8b 15 3c 30 80 00    	mov    0x80303c,%edx
  801cc3:	39 10                	cmp    %edx,(%eax)
  801cc5:	0f 94 c0             	sete   %al
  801cc8:	0f b6 c0             	movzbl %al,%eax
}
  801ccb:	c9                   	leave  
  801ccc:	c3                   	ret    

00801ccd <opencons>:
{
  801ccd:	f3 0f 1e fb          	endbr32 
  801cd1:	55                   	push   %ebp
  801cd2:	89 e5                	mov    %esp,%ebp
  801cd4:	83 ec 24             	sub    $0x24,%esp
	if ((r = fd_alloc(&fd)) < 0)
  801cd7:	8d 45 f4             	lea    -0xc(%ebp),%eax
  801cda:	50                   	push   %eax
  801cdb:	e8 09 f2 ff ff       	call   800ee9 <fd_alloc>
  801ce0:	83 c4 10             	add    $0x10,%esp
  801ce3:	85 c0                	test   %eax,%eax
  801ce5:	78 3a                	js     801d21 <opencons+0x54>
	if ((r = sys_page_alloc(0, fd, PTE_P|PTE_U|PTE_W|PTE_SHARE)) < 0)
  801ce7:	83 ec 04             	sub    $0x4,%esp
  801cea:	68 07 04 00 00       	push   $0x407
  801cef:	ff 75 f4             	pushl  -0xc(%ebp)
  801cf2:	6a 00                	push   $0x0
  801cf4:	e8 b0 ef ff ff       	call   800ca9 <sys_page_alloc>
  801cf9:	83 c4 10             	add    $0x10,%esp
  801cfc:	85 c0                	test   %eax,%eax
  801cfe:	78 21                	js     801d21 <opencons+0x54>
	fd->fd_dev_id = devcons.dev_id;
  801d00:	8b 45 f4             	mov    -0xc(%ebp),%eax
  801d03:	8b 15 3c 30 80 00    	mov    0x80303c,%edx
  801d09:	89 10                	mov    %edx,(%eax)
	fd->fd_omode = O_RDWR;
  801d0b:	8b 45 f4             	mov    -0xc(%ebp),%eax
  801d0e:	c7 40 08 02 00 00 00 	movl   $0x2,0x8(%eax)
	return fd2num(fd);
  801d15:	83 ec 0c             	sub    $0xc,%esp
  801d18:	50                   	push   %eax
  801d19:	e8 9c f1 ff ff       	call   800eba <fd2num>
  801d1e:	83 c4 10             	add    $0x10,%esp
}
  801d21:	c9                   	leave  
  801d22:	c3                   	ret    

00801d23 <ipc_recv>:
//   If 'pg' is null, pass sys_ipc_recv a value that it will understand
//   as meaning "no page".  (Zero is not the right value, since that's
//   a perfectly valid place to map a page.)
int32_t
ipc_recv(envid_t *from_env_store, void *pg, int *perm_store)
{
  801d23:	f3 0f 1e fb          	endbr32 
  801d27:	55                   	push   %ebp
  801d28:	89 e5                	mov    %esp,%ebp
  801d2a:	56                   	push   %esi
  801d2b:	53                   	push   %ebx
  801d2c:	8b 75 08             	mov    0x8(%ebp),%esi
  801d2f:	8b 45 0c             	mov    0xc(%ebp),%eax
  801d32:	8b 5d 10             	mov    0x10(%ebp),%ebx
	// LAB 4: Your code here.
	int error;
	if(!pg)pg = (void *)UTOP; // 如果设置为UTOP，这个值其实可以比UTOP大，设置为这个值认为pg无效了，不会进行页面传递【共享页面的设置】，而是只进行值value的传递。
  801d35:	85 c0                	test   %eax,%eax
  801d37:	ba 00 00 c0 ee       	mov    $0xeec00000,%edx
  801d3c:	0f 44 c2             	cmove  %edx,%eax
	if((error = sys_ipc_recv(pg)) < 0){
  801d3f:	83 ec 0c             	sub    $0xc,%esp
  801d42:	50                   	push   %eax
  801d43:	e8 2d f1 ff ff       	call   800e75 <sys_ipc_recv>
  801d48:	83 c4 10             	add    $0x10,%esp
  801d4b:	85 c0                	test   %eax,%eax
  801d4d:	78 3f                	js     801d8e <ipc_recv+0x6b>
		if(from_env_store)*from_env_store = 0;
		if(perm_store)*perm_store = 0;
		return error;
	}

	thisenv = &envs[ENVX(sys_getenvid())]; // for lab4's challenge sfork().
  801d4f:	e8 0f ef ff ff       	call   800c63 <sys_getenvid>
  801d54:	25 ff 03 00 00       	and    $0x3ff,%eax
  801d59:	6b d0 7c             	imul   $0x7c,%eax,%edx
  801d5c:	81 c2 00 00 c0 ee    	add    $0xeec00000,%edx
  801d62:	89 15 20 60 80 00    	mov    %edx,0x806020

	if(from_env_store)*from_env_store = thisenv->env_ipc_from;
  801d68:	85 f6                	test   %esi,%esi
  801d6a:	74 05                	je     801d71 <ipc_recv+0x4e>
  801d6c:	8b 42 74             	mov    0x74(%edx),%eax
  801d6f:	89 06                	mov    %eax,(%esi)
	if(perm_store)*perm_store = thisenv->env_ipc_perm;
  801d71:	85 db                	test   %ebx,%ebx
  801d73:	74 0a                	je     801d7f <ipc_recv+0x5c>
  801d75:	a1 20 60 80 00       	mov    0x806020,%eax
  801d7a:	8b 40 78             	mov    0x78(%eax),%eax
  801d7d:	89 03                	mov    %eax,(%ebx)
	return thisenv->env_ipc_value;
  801d7f:	a1 20 60 80 00       	mov    0x806020,%eax
  801d84:	8b 40 70             	mov    0x70(%eax),%eax
}
  801d87:	8d 65 f8             	lea    -0x8(%ebp),%esp
  801d8a:	5b                   	pop    %ebx
  801d8b:	5e                   	pop    %esi
  801d8c:	5d                   	pop    %ebp
  801d8d:	c3                   	ret    
		if(from_env_store)*from_env_store = 0;
  801d8e:	85 f6                	test   %esi,%esi
  801d90:	74 06                	je     801d98 <ipc_recv+0x75>
  801d92:	c7 06 00 00 00 00    	movl   $0x0,(%esi)
		if(perm_store)*perm_store = 0;
  801d98:	85 db                	test   %ebx,%ebx
  801d9a:	74 eb                	je     801d87 <ipc_recv+0x64>
  801d9c:	c7 03 00 00 00 00    	movl   $0x0,(%ebx)
  801da2:	eb e3                	jmp    801d87 <ipc_recv+0x64>

00801da4 <ipc_send>:
//   Use sys_yield() to be CPU-friendly.
//   If 'pg' is null, pass sys_ipc_try_send a value that it will understand
//   as meaning "no page".  (Zero is not the right value.)
void
ipc_send(envid_t to_env, uint32_t val, void *pg, int perm)
{
  801da4:	f3 0f 1e fb          	endbr32 
  801da8:	55                   	push   %ebp
  801da9:	89 e5                	mov    %esp,%ebp
  801dab:	57                   	push   %edi
  801dac:	56                   	push   %esi
  801dad:	53                   	push   %ebx
  801dae:	83 ec 0c             	sub    $0xc,%esp
  801db1:	8b 7d 08             	mov    0x8(%ebp),%edi
  801db4:	8b 75 0c             	mov    0xc(%ebp),%esi
  801db7:	8b 5d 10             	mov    0x10(%ebp),%ebx
	// LAB 4: Your code here.
	if(!pg)pg = (void *)UTOP; // 不会进行页面共享，只会sending message。
  801dba:	85 db                	test   %ebx,%ebx
  801dbc:	b8 00 00 c0 ee       	mov    $0xeec00000,%eax
  801dc1:	0f 44 d8             	cmove  %eax,%ebx
	int error;
	// Keep trying until it succeeds.
	while((error = sys_ipc_try_send(to_env, val, pg, perm)) < 0){
  801dc4:	ff 75 14             	pushl  0x14(%ebp)
  801dc7:	53                   	push   %ebx
  801dc8:	56                   	push   %esi
  801dc9:	57                   	push   %edi
  801dca:	e8 7f f0 ff ff       	call   800e4e <sys_ipc_try_send>
  801dcf:	83 c4 10             	add    $0x10,%esp
  801dd2:	85 c0                	test   %eax,%eax
  801dd4:	79 1e                	jns    801df4 <ipc_send+0x50>
        //如果error是没有接收者，那么就会继续尝试send
		if(error != -E_IPC_NOT_RECV){
  801dd6:	83 f8 f9             	cmp    $0xfffffff9,%eax
  801dd9:	75 07                	jne    801de2 <ipc_send+0x3e>
			panic("sys_ipc_try_send:%e", error);
		}
        //但是不是一味的占用cpu，而是尝试一次就释放CPU，等待再次被调度，才会重新send，寻找receiver。
		sys_yield(); // To be CPU-friendly.
  801ddb:	e8 a6 ee ff ff       	call   800c86 <sys_yield>
  801de0:	eb e2                	jmp    801dc4 <ipc_send+0x20>
			panic("sys_ipc_try_send:%e", error);
  801de2:	50                   	push   %eax
  801de3:	68 76 25 80 00       	push   $0x802576
  801de8:	6a 3b                	push   $0x3b
  801dea:	68 8a 25 80 00       	push   $0x80258a
  801def:	e8 b3 e3 ff ff       	call   8001a7 <_panic>
	}
}
  801df4:	8d 65 f4             	lea    -0xc(%ebp),%esp
  801df7:	5b                   	pop    %ebx
  801df8:	5e                   	pop    %esi
  801df9:	5f                   	pop    %edi
  801dfa:	5d                   	pop    %ebp
  801dfb:	c3                   	ret    

00801dfc <ipc_find_env>:
// Find the first environment of the given type.  We'll use this to
// find special environments.
// Returns 0 if no such environment exists.
envid_t
ipc_find_env(enum EnvType type)
{
  801dfc:	f3 0f 1e fb          	endbr32 
  801e00:	55                   	push   %ebp
  801e01:	89 e5                	mov    %esp,%ebp
  801e03:	8b 4d 08             	mov    0x8(%ebp),%ecx
	int i;
	for (i = 0; i < NENV; i++)
  801e06:	b8 00 00 00 00       	mov    $0x0,%eax
		if (envs[i].env_type == type)
  801e0b:	6b d0 7c             	imul   $0x7c,%eax,%edx
  801e0e:	81 c2 00 00 c0 ee    	add    $0xeec00000,%edx
  801e14:	8b 52 50             	mov    0x50(%edx),%edx
  801e17:	39 ca                	cmp    %ecx,%edx
  801e19:	74 11                	je     801e2c <ipc_find_env+0x30>
	for (i = 0; i < NENV; i++)
  801e1b:	83 c0 01             	add    $0x1,%eax
  801e1e:	3d 00 04 00 00       	cmp    $0x400,%eax
  801e23:	75 e6                	jne    801e0b <ipc_find_env+0xf>
			return envs[i].env_id;
	return 0;
  801e25:	b8 00 00 00 00       	mov    $0x0,%eax
  801e2a:	eb 0b                	jmp    801e37 <ipc_find_env+0x3b>
			return envs[i].env_id;
  801e2c:	6b c0 7c             	imul   $0x7c,%eax,%eax
  801e2f:	05 00 00 c0 ee       	add    $0xeec00000,%eax
  801e34:	8b 40 48             	mov    0x48(%eax),%eax
}
  801e37:	5d                   	pop    %ebp
  801e38:	c3                   	ret    

00801e39 <pageref>:
#include <inc/lib.h>

int
pageref(void *v)
{
  801e39:	f3 0f 1e fb          	endbr32 
  801e3d:	55                   	push   %ebp
  801e3e:	89 e5                	mov    %esp,%ebp
  801e40:	8b 45 08             	mov    0x8(%ebp),%eax
	pte_t pte;

	if (!(uvpd[PDX(v)] & PTE_P))
  801e43:	89 c2                	mov    %eax,%edx
  801e45:	c1 ea 16             	shr    $0x16,%edx
  801e48:	8b 0c 95 00 d0 7b ef 	mov    -0x10843000(,%edx,4),%ecx
		return 0;
  801e4f:	ba 00 00 00 00       	mov    $0x0,%edx
	if (!(uvpd[PDX(v)] & PTE_P))
  801e54:	f6 c1 01             	test   $0x1,%cl
  801e57:	74 1c                	je     801e75 <pageref+0x3c>
	pte = uvpt[PGNUM(v)];
  801e59:	c1 e8 0c             	shr    $0xc,%eax
  801e5c:	8b 04 85 00 00 40 ef 	mov    -0x10c00000(,%eax,4),%eax
	if (!(pte & PTE_P))
  801e63:	a8 01                	test   $0x1,%al
  801e65:	74 0e                	je     801e75 <pageref+0x3c>
		return 0;
	return pages[PGNUM(pte)].pp_ref;
  801e67:	c1 e8 0c             	shr    $0xc,%eax
  801e6a:	0f b7 14 c5 04 00 00 	movzwl -0x10fffffc(,%eax,8),%edx
  801e71:	ef 
  801e72:	0f b7 d2             	movzwl %dx,%edx
}
  801e75:	89 d0                	mov    %edx,%eax
  801e77:	5d                   	pop    %ebp
  801e78:	c3                   	ret    
  801e79:	66 90                	xchg   %ax,%ax
  801e7b:	66 90                	xchg   %ax,%ax
  801e7d:	66 90                	xchg   %ax,%ax
  801e7f:	90                   	nop

00801e80 <__udivdi3>:
  801e80:	f3 0f 1e fb          	endbr32 
  801e84:	55                   	push   %ebp
  801e85:	57                   	push   %edi
  801e86:	56                   	push   %esi
  801e87:	53                   	push   %ebx
  801e88:	83 ec 1c             	sub    $0x1c,%esp
  801e8b:	8b 54 24 3c          	mov    0x3c(%esp),%edx
  801e8f:	8b 6c 24 30          	mov    0x30(%esp),%ebp
  801e93:	8b 74 24 34          	mov    0x34(%esp),%esi
  801e97:	8b 5c 24 38          	mov    0x38(%esp),%ebx
  801e9b:	85 d2                	test   %edx,%edx
  801e9d:	75 19                	jne    801eb8 <__udivdi3+0x38>
  801e9f:	39 f3                	cmp    %esi,%ebx
  801ea1:	76 4d                	jbe    801ef0 <__udivdi3+0x70>
  801ea3:	31 ff                	xor    %edi,%edi
  801ea5:	89 e8                	mov    %ebp,%eax
  801ea7:	89 f2                	mov    %esi,%edx
  801ea9:	f7 f3                	div    %ebx
  801eab:	89 fa                	mov    %edi,%edx
  801ead:	83 c4 1c             	add    $0x1c,%esp
  801eb0:	5b                   	pop    %ebx
  801eb1:	5e                   	pop    %esi
  801eb2:	5f                   	pop    %edi
  801eb3:	5d                   	pop    %ebp
  801eb4:	c3                   	ret    
  801eb5:	8d 76 00             	lea    0x0(%esi),%esi
  801eb8:	39 f2                	cmp    %esi,%edx
  801eba:	76 14                	jbe    801ed0 <__udivdi3+0x50>
  801ebc:	31 ff                	xor    %edi,%edi
  801ebe:	31 c0                	xor    %eax,%eax
  801ec0:	89 fa                	mov    %edi,%edx
  801ec2:	83 c4 1c             	add    $0x1c,%esp
  801ec5:	5b                   	pop    %ebx
  801ec6:	5e                   	pop    %esi
  801ec7:	5f                   	pop    %edi
  801ec8:	5d                   	pop    %ebp
  801ec9:	c3                   	ret    
  801eca:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
  801ed0:	0f bd fa             	bsr    %edx,%edi
  801ed3:	83 f7 1f             	xor    $0x1f,%edi
  801ed6:	75 48                	jne    801f20 <__udivdi3+0xa0>
  801ed8:	39 f2                	cmp    %esi,%edx
  801eda:	72 06                	jb     801ee2 <__udivdi3+0x62>
  801edc:	31 c0                	xor    %eax,%eax
  801ede:	39 eb                	cmp    %ebp,%ebx
  801ee0:	77 de                	ja     801ec0 <__udivdi3+0x40>
  801ee2:	b8 01 00 00 00       	mov    $0x1,%eax
  801ee7:	eb d7                	jmp    801ec0 <__udivdi3+0x40>
  801ee9:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
  801ef0:	89 d9                	mov    %ebx,%ecx
  801ef2:	85 db                	test   %ebx,%ebx
  801ef4:	75 0b                	jne    801f01 <__udivdi3+0x81>
  801ef6:	b8 01 00 00 00       	mov    $0x1,%eax
  801efb:	31 d2                	xor    %edx,%edx
  801efd:	f7 f3                	div    %ebx
  801eff:	89 c1                	mov    %eax,%ecx
  801f01:	31 d2                	xor    %edx,%edx
  801f03:	89 f0                	mov    %esi,%eax
  801f05:	f7 f1                	div    %ecx
  801f07:	89 c6                	mov    %eax,%esi
  801f09:	89 e8                	mov    %ebp,%eax
  801f0b:	89 f7                	mov    %esi,%edi
  801f0d:	f7 f1                	div    %ecx
  801f0f:	89 fa                	mov    %edi,%edx
  801f11:	83 c4 1c             	add    $0x1c,%esp
  801f14:	5b                   	pop    %ebx
  801f15:	5e                   	pop    %esi
  801f16:	5f                   	pop    %edi
  801f17:	5d                   	pop    %ebp
  801f18:	c3                   	ret    
  801f19:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
  801f20:	89 f9                	mov    %edi,%ecx
  801f22:	b8 20 00 00 00       	mov    $0x20,%eax
  801f27:	29 f8                	sub    %edi,%eax
  801f29:	d3 e2                	shl    %cl,%edx
  801f2b:	89 54 24 08          	mov    %edx,0x8(%esp)
  801f2f:	89 c1                	mov    %eax,%ecx
  801f31:	89 da                	mov    %ebx,%edx
  801f33:	d3 ea                	shr    %cl,%edx
  801f35:	8b 4c 24 08          	mov    0x8(%esp),%ecx
  801f39:	09 d1                	or     %edx,%ecx
  801f3b:	89 f2                	mov    %esi,%edx
  801f3d:	89 4c 24 08          	mov    %ecx,0x8(%esp)
  801f41:	89 f9                	mov    %edi,%ecx
  801f43:	d3 e3                	shl    %cl,%ebx
  801f45:	89 c1                	mov    %eax,%ecx
  801f47:	d3 ea                	shr    %cl,%edx
  801f49:	89 f9                	mov    %edi,%ecx
  801f4b:	89 5c 24 0c          	mov    %ebx,0xc(%esp)
  801f4f:	89 eb                	mov    %ebp,%ebx
  801f51:	d3 e6                	shl    %cl,%esi
  801f53:	89 c1                	mov    %eax,%ecx
  801f55:	d3 eb                	shr    %cl,%ebx
  801f57:	09 de                	or     %ebx,%esi
  801f59:	89 f0                	mov    %esi,%eax
  801f5b:	f7 74 24 08          	divl   0x8(%esp)
  801f5f:	89 d6                	mov    %edx,%esi
  801f61:	89 c3                	mov    %eax,%ebx
  801f63:	f7 64 24 0c          	mull   0xc(%esp)
  801f67:	39 d6                	cmp    %edx,%esi
  801f69:	72 15                	jb     801f80 <__udivdi3+0x100>
  801f6b:	89 f9                	mov    %edi,%ecx
  801f6d:	d3 e5                	shl    %cl,%ebp
  801f6f:	39 c5                	cmp    %eax,%ebp
  801f71:	73 04                	jae    801f77 <__udivdi3+0xf7>
  801f73:	39 d6                	cmp    %edx,%esi
  801f75:	74 09                	je     801f80 <__udivdi3+0x100>
  801f77:	89 d8                	mov    %ebx,%eax
  801f79:	31 ff                	xor    %edi,%edi
  801f7b:	e9 40 ff ff ff       	jmp    801ec0 <__udivdi3+0x40>
  801f80:	8d 43 ff             	lea    -0x1(%ebx),%eax
  801f83:	31 ff                	xor    %edi,%edi
  801f85:	e9 36 ff ff ff       	jmp    801ec0 <__udivdi3+0x40>
  801f8a:	66 90                	xchg   %ax,%ax
  801f8c:	66 90                	xchg   %ax,%ax
  801f8e:	66 90                	xchg   %ax,%ax

00801f90 <__umoddi3>:
  801f90:	f3 0f 1e fb          	endbr32 
  801f94:	55                   	push   %ebp
  801f95:	57                   	push   %edi
  801f96:	56                   	push   %esi
  801f97:	53                   	push   %ebx
  801f98:	83 ec 1c             	sub    $0x1c,%esp
  801f9b:	8b 44 24 3c          	mov    0x3c(%esp),%eax
  801f9f:	8b 74 24 30          	mov    0x30(%esp),%esi
  801fa3:	8b 5c 24 34          	mov    0x34(%esp),%ebx
  801fa7:	8b 7c 24 38          	mov    0x38(%esp),%edi
  801fab:	85 c0                	test   %eax,%eax
  801fad:	75 19                	jne    801fc8 <__umoddi3+0x38>
  801faf:	39 df                	cmp    %ebx,%edi
  801fb1:	76 5d                	jbe    802010 <__umoddi3+0x80>
  801fb3:	89 f0                	mov    %esi,%eax
  801fb5:	89 da                	mov    %ebx,%edx
  801fb7:	f7 f7                	div    %edi
  801fb9:	89 d0                	mov    %edx,%eax
  801fbb:	31 d2                	xor    %edx,%edx
  801fbd:	83 c4 1c             	add    $0x1c,%esp
  801fc0:	5b                   	pop    %ebx
  801fc1:	5e                   	pop    %esi
  801fc2:	5f                   	pop    %edi
  801fc3:	5d                   	pop    %ebp
  801fc4:	c3                   	ret    
  801fc5:	8d 76 00             	lea    0x0(%esi),%esi
  801fc8:	89 f2                	mov    %esi,%edx
  801fca:	39 d8                	cmp    %ebx,%eax
  801fcc:	76 12                	jbe    801fe0 <__umoddi3+0x50>
  801fce:	89 f0                	mov    %esi,%eax
  801fd0:	89 da                	mov    %ebx,%edx
  801fd2:	83 c4 1c             	add    $0x1c,%esp
  801fd5:	5b                   	pop    %ebx
  801fd6:	5e                   	pop    %esi
  801fd7:	5f                   	pop    %edi
  801fd8:	5d                   	pop    %ebp
  801fd9:	c3                   	ret    
  801fda:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
  801fe0:	0f bd e8             	bsr    %eax,%ebp
  801fe3:	83 f5 1f             	xor    $0x1f,%ebp
  801fe6:	75 50                	jne    802038 <__umoddi3+0xa8>
  801fe8:	39 d8                	cmp    %ebx,%eax
  801fea:	0f 82 e0 00 00 00    	jb     8020d0 <__umoddi3+0x140>
  801ff0:	89 d9                	mov    %ebx,%ecx
  801ff2:	39 f7                	cmp    %esi,%edi
  801ff4:	0f 86 d6 00 00 00    	jbe    8020d0 <__umoddi3+0x140>
  801ffa:	89 d0                	mov    %edx,%eax
  801ffc:	89 ca                	mov    %ecx,%edx
  801ffe:	83 c4 1c             	add    $0x1c,%esp
  802001:	5b                   	pop    %ebx
  802002:	5e                   	pop    %esi
  802003:	5f                   	pop    %edi
  802004:	5d                   	pop    %ebp
  802005:	c3                   	ret    
  802006:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
  80200d:	8d 76 00             	lea    0x0(%esi),%esi
  802010:	89 fd                	mov    %edi,%ebp
  802012:	85 ff                	test   %edi,%edi
  802014:	75 0b                	jne    802021 <__umoddi3+0x91>
  802016:	b8 01 00 00 00       	mov    $0x1,%eax
  80201b:	31 d2                	xor    %edx,%edx
  80201d:	f7 f7                	div    %edi
  80201f:	89 c5                	mov    %eax,%ebp
  802021:	89 d8                	mov    %ebx,%eax
  802023:	31 d2                	xor    %edx,%edx
  802025:	f7 f5                	div    %ebp
  802027:	89 f0                	mov    %esi,%eax
  802029:	f7 f5                	div    %ebp
  80202b:	89 d0                	mov    %edx,%eax
  80202d:	31 d2                	xor    %edx,%edx
  80202f:	eb 8c                	jmp    801fbd <__umoddi3+0x2d>
  802031:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
  802038:	89 e9                	mov    %ebp,%ecx
  80203a:	ba 20 00 00 00       	mov    $0x20,%edx
  80203f:	29 ea                	sub    %ebp,%edx
  802041:	d3 e0                	shl    %cl,%eax
  802043:	89 44 24 08          	mov    %eax,0x8(%esp)
  802047:	89 d1                	mov    %edx,%ecx
  802049:	89 f8                	mov    %edi,%eax
  80204b:	d3 e8                	shr    %cl,%eax
  80204d:	8b 4c 24 08          	mov    0x8(%esp),%ecx
  802051:	89 54 24 04          	mov    %edx,0x4(%esp)
  802055:	8b 54 24 04          	mov    0x4(%esp),%edx
  802059:	09 c1                	or     %eax,%ecx
  80205b:	89 d8                	mov    %ebx,%eax
  80205d:	89 4c 24 08          	mov    %ecx,0x8(%esp)
  802061:	89 e9                	mov    %ebp,%ecx
  802063:	d3 e7                	shl    %cl,%edi
  802065:	89 d1                	mov    %edx,%ecx
  802067:	d3 e8                	shr    %cl,%eax
  802069:	89 e9                	mov    %ebp,%ecx
  80206b:	89 7c 24 0c          	mov    %edi,0xc(%esp)
  80206f:	d3 e3                	shl    %cl,%ebx
  802071:	89 c7                	mov    %eax,%edi
  802073:	89 d1                	mov    %edx,%ecx
  802075:	89 f0                	mov    %esi,%eax
  802077:	d3 e8                	shr    %cl,%eax
  802079:	89 e9                	mov    %ebp,%ecx
  80207b:	89 fa                	mov    %edi,%edx
  80207d:	d3 e6                	shl    %cl,%esi
  80207f:	09 d8                	or     %ebx,%eax
  802081:	f7 74 24 08          	divl   0x8(%esp)
  802085:	89 d1                	mov    %edx,%ecx
  802087:	89 f3                	mov    %esi,%ebx
  802089:	f7 64 24 0c          	mull   0xc(%esp)
  80208d:	89 c6                	mov    %eax,%esi
  80208f:	89 d7                	mov    %edx,%edi
  802091:	39 d1                	cmp    %edx,%ecx
  802093:	72 06                	jb     80209b <__umoddi3+0x10b>
  802095:	75 10                	jne    8020a7 <__umoddi3+0x117>
  802097:	39 c3                	cmp    %eax,%ebx
  802099:	73 0c                	jae    8020a7 <__umoddi3+0x117>
  80209b:	2b 44 24 0c          	sub    0xc(%esp),%eax
  80209f:	1b 54 24 08          	sbb    0x8(%esp),%edx
  8020a3:	89 d7                	mov    %edx,%edi
  8020a5:	89 c6                	mov    %eax,%esi
  8020a7:	89 ca                	mov    %ecx,%edx
  8020a9:	0f b6 4c 24 04       	movzbl 0x4(%esp),%ecx
  8020ae:	29 f3                	sub    %esi,%ebx
  8020b0:	19 fa                	sbb    %edi,%edx
  8020b2:	89 d0                	mov    %edx,%eax
  8020b4:	d3 e0                	shl    %cl,%eax
  8020b6:	89 e9                	mov    %ebp,%ecx
  8020b8:	d3 eb                	shr    %cl,%ebx
  8020ba:	d3 ea                	shr    %cl,%edx
  8020bc:	09 d8                	or     %ebx,%eax
  8020be:	83 c4 1c             	add    $0x1c,%esp
  8020c1:	5b                   	pop    %ebx
  8020c2:	5e                   	pop    %esi
  8020c3:	5f                   	pop    %edi
  8020c4:	5d                   	pop    %ebp
  8020c5:	c3                   	ret    
  8020c6:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
  8020cd:	8d 76 00             	lea    0x0(%esi),%esi
  8020d0:	29 fe                	sub    %edi,%esi
  8020d2:	19 c3                	sbb    %eax,%ebx
  8020d4:	89 f2                	mov    %esi,%edx
  8020d6:	89 d9                	mov    %ebx,%ecx
  8020d8:	e9 1d ff ff ff       	jmp    801ffa <__umoddi3+0x6a>
